Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CreateNewFrame ends in Unhandled Exception

37 views
Skip to first unread message

baeman

unread,
Aug 14, 2008, 4:47:26 AM8/14/08
to
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

Ajay Kalra

unread,
Aug 14, 2008, 9:26:54 AM8/14/08
to
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

nor...@hotmail.com

unread,
Dec 29, 2010, 6:10:41 AM12/29/10
to

Dear techies,
Have anyone faced similar issue n solved this.

"Unhandled Exception from CreateNewFrame"


--
swapn...@gmail.com
------------------------------------------------------------------------
swapn...@gmail.com's Profile: http://microsoft-news.for-um.de/member.php?userid=10031
View this thread: http://microsoft-news.for-um.de/showthread.php?t=34049


Powered by: http://poker-and-gambling-news.for-um.de/ | http://microsoft-news.for-um.de | http://ibm-news.for-um.de | http://www.for-um.de | http://www.uzenet.org

Joseph M. Newcomer

unread,
Dec 29, 2010, 11:56:38 PM12/29/10
to
Well, solving this requires a certain amount of information, such as a complete example of
the code, information about the values of all variables involved, and someone who has
single-stepped into CreateNewFrame to determine the precise point of execution (and all
variable values involved) where the error occurs.
joe

On Wed, 29 Dec 2010 12:10:41 +0100, nor...@hotmail.com wrote:

>
>Dear techies,
>Have anyone faced similar issue n solved this.
>
>"Unhandled Exception from CreateNewFrame"

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

0 new messages