tdietz
asked on
Trying to use CreateWindowEx
I am trying to create a standard SDI window with CreateWindowEx. I have registered a custom class and tried the following:
CreateEx( WS_EX_CLIENTEDGE,
NULL,
theApp.m_NewMailWndClass, // my own class
"new window",
WS_BORDER | WS_CHILD,
rect,
NULL,
0);
I registered the class like this:
m_NewMailWndClass = AfxRegisterWndClass(CS_HRE DRAW|CS_VR EDRAW));
The "rect" is set to 0,0,100,100 (I size it later)
CreateWindowEx fails (0)
Any suggestions?
I am calling this from an MFC-SDI window (toolbar button callback)
CreateEx( WS_EX_CLIENTEDGE,
NULL,
theApp.m_NewMailWndClass, // my own class
"new window",
WS_BORDER | WS_CHILD,
rect,
NULL,
0);
I registered the class like this:
m_NewMailWndClass = AfxRegisterWndClass(CS_HRE
The "rect" is set to 0,0,100,100 (I size it later)
CreateWindowEx fails (0)
Any suggestions?
I am calling this from an MFC-SDI window (toolbar button callback)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
To mbhakta : I was under the impression that the class is automatically unregistered.Is it not?
To tdietz : I am unable to guess as to what could be the cause.Can you call "GetLastError()" and find out?Will it give you some clue?
Regards,
Amaresh