Hi,
I am trying to create a simple SDI application using MFC.
My programme is compiling correctly but when i am trying to execute it i get an error "Unable to Create empty Document" . The following is the code i used in my Application class InitInstance method...
I am getting the error on the call of 'OnFileNew' function.
What is it that i am doing wrong . Please help.
Thanks..
I am trying to create a simple SDI application using MFC.
My programme is compiling correctly but when i am trying to execute it i get an error "Unable to Create empty Document" . The following is the code i used in my Application class InitInstance method...
Code:
BOOL C_CustomApp::InitInstance()
{
CSingleDocTemplate* pDocTemplate;
pDocTemplate= new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(C_CustomDoc),
RUNTIME_CLASS(C_MainFrame),
RUNTIME_CLASS(C_CustomView));
AddDocTemplate(pDocTemplate);
EnableShellOpen();
RegisterShellFileTypes();
if(m_lpCmdLine[0] == '\0')
{
OnFileNew();
}
else
{
OpenDocumentFile(m_lpCmdLine);
}
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
I am getting the error on the call of 'OnFileNew' function.
What is it that i am doing wrong . Please help.
Thanks..
Last edited by a moderator: