glGetString problems

i have an options dialog that starts up before the actual program starts. the option dialog has a details dialog that shows information such as GL_VENDOR, GL_RENDERER, etc. however, when i try to get the requested information, it cannot be found.

if i have a dummy dialog that performs the exact same thing with the exception that it is invoked after the program starts, it can find the relevant information.

my question is: do you have to create a working window with opengl already running to get this information, or can you just call glGetString regardless if opengl is set up or not?

You’ll need to actually get OpenGL initialized in order for the glGetString to work. I have a dialog box that I used to display a list of extensions that a card supports, and the way I got around it was to place a small non-visible static control somewhere on the dialog, then used the HDC from that to initialize OpenGL. If I recall, I just had to go through the pixelformat and wgl functions for glGetString to work. There’s no need to setup the projection matrix, or any other initialization stuff after enabling OpenGL for the HDC.