Re: CreateNewFrame ends in Unhandled Exception
- From: Ajay Kalra <ajaykalra@xxxxxxxxx>
- Date: Thu, 14 Aug 2008 06:26:54 -0700 (PDT)
What does the exception say? Did you confirm that
pDocTemplateForceModel is valid? Step in debugger and see where does
the problem occur.
Also, since pDocTemplateForceModel is a class member, I would use
m_pDocTemplateForceModel as the name so that you can differentiate
between class members and local variables.
--
Ajay
On Aug 14, 4:47 am, baeman <bae...@xxxxxxx> wrote:
I have to create a new view, the following code creates a new document
of the DocTemplate which is
written in the second code part
####################################
Code:
void CNoNameApp::OnNewForceModel()
{
CForceModel_Doc* fModelDoc;
fModelDoc = (CForceModel_Doc*) pDocTemplateForceModel-
CreateNewDocument();
CString title = "Force Model";
fModelDoc->setTitle(title);
// Create FormView
CDiagramFormFrameChild* pFormView = (CDiagramFormFrameChild*)
pDocTemplateForceModel->CreateNewFrame(fModelDoc, NULL);
pDocTemplateForceModel->InitialUpdateFrame(pFormView,fModelDoc,TRUE);
}
#########################
the doctemplate is implemented in the app
Code:
##########################
pDocTemplateForceModel = new CMultiDocTemplate(IDR_MAINFRAME,
RUNTIME_CLASS(CForceModel_Doc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CForceModel_View));
if (!pDocTemplateForceModel)
return FALSE;
AddDocTemplate(pDocTemplateForceModel);
##########################
I end up with an unhandled exception within the CreateNewFrame
function.
The doc template can't create a frame
Does someone have an idea why this is not working this time... and for
all my other views it's working fine?
thanks BaeMan
.
- References:
- CreateNewFrame ends in Unhandled Exception
- From: baeman
- CreateNewFrame ends in Unhandled Exception
- Prev by Date: CMFCMenuBar + menu accelerators/mnemonics
- Next by Date: Catch WM_SIZE
- Previous by thread: CreateNewFrame ends in Unhandled Exception
- Next by thread: CMFCMenuBar + menu accelerators/mnemonics
- Index(es):