PDA

View Full Version : How to shift codes from WIN32 API to MFC



07-08-2004, 02:25 AM
I've bought OpenGl 2nd edition. In chapter 17,
the codes were for WIN32 API. I want to shift
to MFC use MFC AppWizard. But I encountered a
problem.
For the belowing codes I didn't know how to
setup wc.style in MFC
application
int APIENTRY WinMain()
{
...
WNDCLASS wc;
...
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC
...
}
Somebody helps....

Aeluned
07-08-2004, 05:09 AM
This post really has nothing to do with OpenGL, and should have been posted in 'OpenGL under Windows'

The MFC app Wizard will create a MainFrame class for you (CMainFrame), in there you'll find this function:



BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs

return TRUE;
}make your changes there.

cheers.