noob question: gl contex creation

so how can I create glrc without creating a dummy window so that I can get all the extension entries before I create the normal rendering window?

GetDesktopWindow() should be the only solution, but once I got its hdc I failed to create glrc.

is there something I miss or a better solution, maybe?

No, you cant.

Thanks for reply dude.
But AFAIK someone did that but I just cant remember how its done. And besides, why would I failed to create glrc with desktop hdc?

AFAIK the only way to do what you want to do (in a reliable fashion) is to create a invisible window first.

You should not use the desktop window, because your process does not own the desktop window and SetPixelFormat() can only be called once in the whole lifetime of a window.

Problem solved. I just forgot to set the pixel format of desktop window.
But as you said, right, the pixelformat of desktop window can only be set once in its whole lifetime but, the second run works fine as well, and so did the third…
Very strange, huh? Maybe its not persistent or something?

I am sorry, I have been to vague.

As long as you call it with the same pixelformat, everything should be fine (it may depend on the driver though) but if you, or any other software for that matter, try to set a different pixelformat it will fail (may depend on the driver too).

Therefore I think that it is a very ugly hack to abuse the desktop window for this kind of stuff.

Its of course just my personal opinion, you may do as you like.

I’ll keep a copy of my previous version of initialization code in case failure occurs.