Click to See Complete Forum and Search --> : A peoblem about using OpenGL in Windows NT


Hud Lu
May 17th, 1999, 07:40 AM
I used the following codes to draw in a Ole server:
CDC memoryDC;
memoryDC.CreateCompatibleDC(NULL);
PIXELFORMATDESCRIPTOR pfd=
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW|
PFD_SUPPORT_OPENGL,
PFD_TYPE_RGBA,
24,
0,0,0,0,0,0,
0,0,0,0,0,0,0,
32,
0,0,
PFD_MAIN_PLANE,
0,0,0,0
};

int pixelFormat=ChoosePixelFormat(MemDC.m_hDC, &pfd);
BOOL success=SetPixelFormat(MemDC.m_hDC, pixelFormat, &pfd);

but the SetPixelFormat always returns FALSE,
when i used GetLastError(), the error number is 0.
this only occurs in Windows