CAD collapse while closing if I create a CDocument in CAD winFrame
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I create a CDocument attached a dialog in CAD winFrame,and switch this document with other dwg drawings,for example, there are two dwg and one CDOcument create by mine,when I switch from A.dwg to B.dwg, which trigger the function AcApDocManagerReactor::documentActivated() in that I use code "CView* pViewA = acedGetAcadDwgView();" ,and when I use code "(CMDIFrameWnd*)(acedGetAcadFrame())->MDIActivate(pWndAttachMyCDocument)"to switch from B.dwg to my CDocument, AcApDocManagerReactor::documentToBeDeactivated is triggerred but AcApDocManagerReactor::documentActivated() isn't triggerred. and at last, I use code "acDocManagerPtr()->activateDocument(A.dwg)"switch from my CDocument to A.dwg, which trigger the function AcApDocManagerReactor::documentActivated() and in that function the CView returned by acedGetAcadDwgView() is CView of A.dwg , at last ,if I click close button of CAD to exit , the AcApDocManagerReactor::documentDestroyed(const ACHAR* fileName) is triggerred and fileName is A.dwg, but cad breakdown after this function finished。
The breakdown order is:
A.dwg ->B.dwg->my CDocument attached a dialog ->A.dwg->close CAD->AcApDocManagerReactor::documentDestroyed(A.dwg's filename) ->breakdown
Crash stack
However,it close successfully if the order is like below:
A.dwg ->B.dwg->my CDocument attached a dialog ->A.dwg->->B.dwg->close CAD->AcApDocManagerReactor::documentDestroyed(B.dwg's filename) ->->AcApDocManagerReactor::documentDestroyed(A.dwg's filename)->close successfully.
it seems that my cdocument disturbs the cview of dwg to close?