This topic is now archived and is closed to further replies.


Problems with wglCreateContext()

Recommended Posts

Here's the code:
hRC = wglCreateContext(hDC);
if(hRC == NULL)
     MessageBox(NULL, "Can not create the Rendering Context. This application will now close.", "GLCrusader", MB_OK);
//   ShutDown();

     return false;
Every time the hRC comes back NULL, and all functions taking hRC as an argument fail, but GetLastError() ( held within the function ShowLastError() ) comes back with the error code 0x00000000 ( The function completed successfuly ). Has anyone else had this problem? Does anyone know what might cause wglCreateContext() to fail? //////////// // Update // //////////// My problem was that I forgot to call SetPixelFormat() before hand. This still does not excuse the error code however. [edited by - QBRADQ on December 27, 2002 1:56:41 AM]

Share this post

Link to post
Share on other sites
Is your PixelFormat ok ?

int PixelFormat ChoosePixelFormat(Canvas->Handle,&pfd);
isnt PixelFormat NULL ?
or what does that return ?

Share this post

Link to post
Share on other sites