About Voodoo5 Video Card

I changed my video card recently, the new one is 3dfx Voodoo5. Now a problem appears. I find the function wglDeleteContext(hRC) does not work well. If I run our application in debug mood(Go F5) in Microsoft Visual Studio, it will go inside assembly code when this function(wglDeleteContext(hRC) ) is called. Although I can still go ahead, it is annoying. Is there anyone who know how to solve the problem? Please advise. Thanks a lot. My email is: yjzr@yahoo.com.

And where you’ve this problem?
Try this :
To hRc assign wglCreateContext(hDC) then
call wglMakeCurrent(hDC,hRc);

[This message has been edited by FoxDie (edited 01-04-2001).]

Thank you! I did it in my code, it does not work. Now something more serious happened: When I run our program in release, it just crashs! The problem comes from 3DFXOGL.DLL. Any suggestion?

Now you must set pixelformatdescriptor.
int iFormat;

ZeroMemory( pfd, sizeof( pfd ) );
pfd.nSize= sizeof( pfd );
pfd.nVersion= 1;
pfd.dwFlags= PFD_DRAW_TO_WINDOW |
pfd.iPixelType= PFD_TYPE_RGBA;
pfd.cColorBits= 24;
pfd.cDepthBits= 16;
pfd.iLayerType= PFD_MAIN_PLANE;
iFormat= ChoosePixelFormat(hDC,PFD);
SetPixelFormat( hDC, iFormat, pfd );

[This message has been edited by FoxDie (edited 01-04-2001).]

Thank you for your help. Here is my code, I am not sure if there is some problem. It works fine with other video card.

PFD_TYPE_RGBA, 32, // 32-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored

int pixelformat;
if ( (pixelformat = ChoosePixelFormat(m_pCDC->GetSafeHdc(), &pfd)) == 0 )
AfxMessageBox(“ChoosePixelFormat failed”);
return FALSE;
if (SetPixelFormat(m_pCDC->GetSafeHdc(), pixelformat, &pfd) == FALSE)
pixelformat = 1;
if (DescribePixelFormat(m_pCDC->GetSafeHdc(), pixelformat, sizeof(PIXELFORMATDESCRIPTOR), &pfd)==0)
AfxMessageBox(“SetPixelFormat failed (no OpenGL compatible video mode)”);
return FALSE;