Using CreateDC instead of GetDC

  1. use CreateDC to create DC
  2. use ChoosePixelFormat and SetPixelFormat

But point 4 fails - I have got error message:
“The window style or class attribute is invalid for this operation.”

It is a bit strange cause:
a) when I use GetDC to create OpenGL - everything works Ok (but I cannot
choose video card using GetDC)
b) I do not set window (do not use HWND) anywhere in CreateDC or
ChoosePixelFormat or SetPixelFormat!

I have following questions:
a) have anyone used dc created with CreateDC to initialize OpenGL
b) is there any other way to select video card for OpenGL?

Thank in advance for help…

[This message has been edited by mancy (edited 12-12-2003).]

a)I haven’t tried
b)You just put a window on a specific screen and the card that displays this screen is the “OpenGL card” for that window.