May 10th, 1999, 11:19 AM
Hello all
This has got to be something stupid I'm missing but I hope someone out there would be kind enough to show me what it is :
I have an MDI project where the App class handles the OnFileOpen command. What I want is for it to close all open windows (views) + docs (actually I allow only one open Doc but thats beside the point) and only then, go into the CWinApp::OnFileOpen. I rigged my OnFileOpen as such :
CMDIChildWnd *pChild = ((CMainFrame *)AfxGetMainWnd())->
MDIGetActive();
if (pChild)
{
COdinDoc * pDoc = ((COdinDoc *)pChild->
GetActiveDocument());
if (pDoc)
pDoc->OnCloseDocument();
}
CWinApp::OnFileOpen();
And I have the following annoying problem : The doc + it's view do get closed BUT, once into CWinApp::OnFileOpen() I get an assert failure. This does not happen if I use the File menu "Close" option and then open a file manually (file Open option)
Anybody has any ideas ? Please let me know caus it's driving me crazy !
ThanX
Frost
This has got to be something stupid I'm missing but I hope someone out there would be kind enough to show me what it is :
I have an MDI project where the App class handles the OnFileOpen command. What I want is for it to close all open windows (views) + docs (actually I allow only one open Doc but thats beside the point) and only then, go into the CWinApp::OnFileOpen. I rigged my OnFileOpen as such :
CMDIChildWnd *pChild = ((CMainFrame *)AfxGetMainWnd())->
MDIGetActive();
if (pChild)
{
COdinDoc * pDoc = ((COdinDoc *)pChild->
GetActiveDocument());
if (pDoc)
pDoc->OnCloseDocument();
}
CWinApp::OnFileOpen();
And I have the following annoying problem : The doc + it's view do get closed BUT, once into CWinApp::OnFileOpen() I get an assert failure. This does not happen if I use the File menu "Close" option and then open a file manually (file Open option)
Anybody has any ideas ? Please let me know caus it's driving me crazy !
ThanX
Frost