Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

wglMakeCurrent - The handle is invalid

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 scarecr0w132   Members   

105
Like
0Likes
Like

Posted 29 December 2013 - 08:12 PM

Hello,
 

I am fairly new to OpenGL, I don't fully understand everything yet :)  
I have a viewer with a context. It is being drawn on the UI which has another separate context. (I am using QT for UI, and trying to draw widgets ontop of viewer.) 
wglMakeCurrent() which gets called in the viewer code, fails and says from GetLastError(): wglMakeCurrent() failed. The handle is invalid.
This is how it is called:
 
...
if (wglMakeCurrent ((HDC )myWindowDC, (HGLRC )myGContext) != TRUE)
...

I uploaded the project if anyone wants to take a look.
What is a likely cause of this?

 

Attached Files



#2 Vortez   Members   

2710
Like
1Likes
Like

Posted 29 December 2013 - 09:05 PM

You could try calling GetLastError() to get a better idea of what is causing the error.



#3 scarecr0w132   Members   

105
Like
0Likes
Like

Posted 29 December 2013 - 09:46 PM

You could try calling GetLastError() to get a better idea of what is causing the error.

 

Hi Vortez, as I said in my post GetLastError() code returned is : The handle is invalid.

Thanks



#4 wintertime   Members   

4073
Like
0Likes
Like

Posted 30 December 2013 - 06:14 AM

As you did not show how you defined myWindowDC and myGContext, and maybe they are classes only containing those handles as member, you may want to remove the typecasts inside the call to avoid hiding an error there. Then you should get a compiler error if that is the problem.

Otherwise look if the context got destroyed somewhere.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.