We need to see more of your program. We don't know what order you're calling these functions in, if or when your lpfnWndProc callback is calling your "drawgame__()" function. I want to assume that hWnd is global, but why then are you passing it into your "EnableOpenGL()" function? There are a few more confusing things that need to be cleared up.