
Calling OnNewDocument from outside CMyApp ...
Hello all,
Initially I was trying to call a member function to get a
new CHtmlView document,
CHtmlView* CUIMApp::OnNewHtml() {
ASSERT(m_pHtmlTemplate);
CDocument* pDoc = m_pHtmlTemplate->OpenDocumentFile
(0);
//pDoc->SetTitle("New Buddy");
//POSITION pos = pDoc->GetFirstViewPosition();
//return (CHtmlView*)pDoc->GetNextView( pos );
return 0;
Quote:
}
but calling this like theApp.OnNewHtml(), causes an
unhandled excpetion (even though calling it from the menu
works everytime) ... failing on ASSERT(m_hWnd ==
hwnd) .. in winmdi.cpp, function CMDIChildWnd::Create
(...), line 585 , so Im trying to send it a
message so that CUIMApp can call it self. CWinApp doesnt
have m_hWnd , so what is my first paramter to SendMessage ?
(I tried AfxGetMainWnd()->GetSafeHwnd() with no luck)
Thanks so much for any help!! Please help!
Charles