i am a beginner in MFC programming and using MS VC++ 6.0. I am trying to create my own window using AfxRegisterWndClass(). My code is as follows :
Frame::Frame()
{
LPCTSTR className;
HBRUSH brush;
brush = (HBRUSH) ::GetStockObject (BLACK_BRUSH);
className = ::AfxRegisterWndClass (WS_OVERLAPPEDWINDOW, AfxGetApp()->LoadStandardCursor (IDC_CROSS),
brush,
AfxGetApp()->LoadStandardIcon (IDI_ERROR));
Create (className, "BHOOT");
// Create (NULL, "Bhoot", WS_OVERLAPPEDWINDOW, rectDefault, NULL, NULL, 0, NULL);
}
The above code segment shows the constructor of Frame class, the class derived from CFrameWnd. Also, FYI, i havent used document/view architecture.
Now, my problem is when i run my code, i meet with an error saying :
" This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for further information."
however, when i dont register my own window class and rather proceed with a frame using CWnd::Create() function, i dont face any such error.
can anyone throw some light on my problem.?? :|