Click to See Complete Forum and Search --> : Please Help!!! CWnd::Create()


Hardeep Singh
April 23rd, 1999, 05:22 AM
I'm using a CWnd-derived class for the first time, I'va always worked with CFrameWnd-Derived classes... I'm getting an Access Violation error with the following code:

Create(NULL,"Virtual Desktop",WS_FLAGS,CRect(0,0,640,480),NULL,0,NULL);



Where WS_FLAGS = WS_VISIBLE|WS_MAXIMIZE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS

I'm trying to create a full-screen main window... What window styles should I be using? Is the problem somewhere else?

Thanks,
Hardeep

Martin Speiser
April 23rd, 1999, 06:21 AM
Hi Hardeep,

first of all you should register a window class with AfxRegisterWndClass. The result can be used as the class name (first parameter) in Create.


Martin