kimi
2004-08-10 01:13:09 UTC
I hate the wizard, because it only let me create the mdi/sdi and dialog box.
I want to create my own windows with MFC. So, I create a dialog box project
and delete all info about dialog box, then inherit the CWnd class and create
in the CWinApp's function. like following:
BOOL CCreateWndApp::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// this is what I write
CTestWnd test;
CString classname = AfxRegisterWndClass(CS_DBLCLKS);
//assert will occour when create window
test.Create((LPCTSTR)classname,
TEXT("TEST"),
WS_VISIBLE | WS_OVERLAPPED,
CRect(100,100,300,300),
NULL,
IDW_MAIN_WND,
NULL);
return TRUE;
}
There is a Assertion fail: file wincore.cpp line 735.
I want to create my own windows with MFC. So, I create a dialog box project
and delete all info about dialog box, then inherit the CWnd class and create
in the CWinApp's function. like following:
BOOL CCreateWndApp::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// this is what I write
CTestWnd test;
CString classname = AfxRegisterWndClass(CS_DBLCLKS);
//assert will occour when create window
test.Create((LPCTSTR)classname,
TEXT("TEST"),
WS_VISIBLE | WS_OVERLAPPED,
CRect(100,100,300,300),
NULL,
IDW_MAIN_WND,
NULL);
return TRUE;
}
There is a Assertion fail: file wincore.cpp line 735.