wglMakeCurrent and GetOpenFileName


I have created a Win32 application (No MFC) and have a main window with four child windows inside. Any time I try to use GetOpenFileName after I have used wglMakeCurrent the dialog won’t appear and the app just hangs. I tried using GetOpenFileName when the scene is displayed in the main window with no child windows and this works fine.

Any ideas?

Hmm, you’re calling this in a ondraw callback then?

Shouldn’t you pass an event that get’s picked up in your handler and creates the dialog?

Sorry, I don’t think I was very clear in my first post. I am calling GetOpenFileName in response to a menu selection in my main handler. Wglmakecurrent is called during my initialisation of the windows not at the same time as GetOpenFileName.