<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CAD collapse while closing if I create a CDocument in CAD winFrame in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9706669#M4226</link>
    <description>"acDocManagerPtr()-&amp;gt;removeReactor(AcApDocManagerReactor) "in commandWillStart("quit") or commandWillStart ("quit") will crash down</description>
    <pubDate>Sun, 23 Aug 2020 12:44:27 GMT</pubDate>
    <dc:creator>27925916</dc:creator>
    <dc:date>2020-08-23T12:44:27Z</dc:date>
    <item>
      <title>CAD collapse while closing if I create a CDocument in CAD winFrame</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9651102#M4224</link>
      <description>&lt;P&gt;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&amp;nbsp;AcApDocManagerReactor::documentActivated() in that I use code "CView* pViewA = acedGetAcadDwgView();" ,and when I use code "(CMDIFrameWnd*)(acedGetAcadFrame())-&amp;gt;MDIActivate(pWndAttachMyCDocument)"to switch from B.dwg to my CDocument, AcApDocManagerReactor::documentToBeDeactivated is triggerred but AcApDocManagerReactor::documentActivated() isn't triggerred. and&amp;nbsp; at last, I use code "acDocManagerPtr()-&amp;gt;activateDocument(A.dwg)"switch from my CDocument to A.dwg, which trigger the function&amp;nbsp;AcApDocManagerReactor::documentActivated()&amp;nbsp; and in that function the CView returned by&amp;nbsp; acedGetAcadDwgView()&amp;nbsp; is CView of A.dwg , at last ,if I click close button of CAD to exit , the&amp;nbsp;AcApDocManagerReactor::documentDestroyed(const ACHAR* fileName) is triggerred and&amp;nbsp;fileName is A.dwg, but cad breakdown after this function&amp;nbsp;finished。&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The breakdown order is:&lt;/P&gt;&lt;P&gt;A.dwg -&amp;gt;B.dwg-&amp;gt;my CDocument attached a dialog -&amp;gt;A.dwg-&amp;gt;close CAD-&amp;gt;AcApDocManagerReactor::documentDestroyed(A.dwg's filename) -&amp;gt;breakdown&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Crash stack&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tt.png" style="width: 308px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/798489iB853E80DAB4374CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="tt.png" alt="tt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,it close successfully if the order is like below：&lt;/P&gt;&lt;P&gt;A.dwg -&amp;gt;B.dwg-&amp;gt;my CDocument attached a dialog -&amp;gt;A.dwg-&amp;gt;-&amp;gt;B.dwg-&amp;gt;close CAD-&amp;gt;AcApDocManagerReactor::documentDestroyed(B.dwg's filename) -&amp;gt;-&amp;gt;AcApDocManagerReactor::documentDestroyed(A.dwg's filename)-&amp;gt;close successfully.&lt;/P&gt;&lt;P&gt;it seems that my cdocument&amp;nbsp;&lt;SPAN&gt;disturbs the cview of dwg to close?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 10:21:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9651102#M4224</guid>
      <dc:creator>27925916</dc:creator>
      <dc:date>2020-07-23T10:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: CAD collapse while closing if I create a CDocument in CAD winFrame</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9673902#M4225</link>
      <description>&lt;P&gt;It is hard to tell what leads to the crash without source code that shows what your &lt;FONT face="courier new,courier"&gt;AcApDocManagerReactor&lt;/FONT&gt; is doing. Have you tried to simply disable your &lt;FONT face="courier new,courier"&gt;AcApDocManagerReactor&lt;/FONT&gt; as soon an AutoCAD ends?&lt;/P&gt;
&lt;P&gt;Try to do this within &lt;FONT face="courier new,courier"&gt;AcEditorReactor::commandWillStart(L"QUIT")&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the order of events I see in AutoCAD 2020 upon QUIT:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;AcEditorReactor::commandWillStart('QUIT')&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;AcEditorReactor::commandEnded('QUIT')&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;AcApDocManagerReactor::documentToBeDestroyed(Drawing1.dwg)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;::acrxEntryPoint(AcRx::kUnloadDwgMsg)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;AcApDocManagerReactor::documentDestroyed(Drawing1.dwg)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;::acrxEntryPoint(AcRx::kQuitMsg)&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 05 Aug 2020 09:05:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9673902#M4225</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-08-05T09:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: CAD collapse while closing if I create a CDocument in CAD winFrame</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9706669#M4226</link>
      <description>"acDocManagerPtr()-&amp;gt;removeReactor(AcApDocManagerReactor) "in commandWillStart("quit") or commandWillStart ("quit") will crash down</description>
      <pubDate>Sun, 23 Aug 2020 12:44:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9706669#M4226</guid>
      <dc:creator>27925916</dc:creator>
      <dc:date>2020-08-23T12:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: CAD collapse while closing if I create a CDocument in CAD winFrame</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9707743#M4227</link>
      <description>&lt;P&gt;Can you try to "disable" your reactor in &lt;FONT face="courier new,courier"&gt;commandWillStart("quit")&lt;/FONT&gt; instead of removing it?&lt;/P&gt;
&lt;P&gt;I.e. like this:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;class MyAcApDocManagerReactor: public AcApDocManagerReactor {
  public:
     void setDisabled(bool disabled) { m_ReactorDisabled = disabled; }
  private:
     bool m_ReactorDisabled=false;
}

void MyAcApDocManagerReactor::documentToBeDestroyed(AcApDocument* pDocToDestroy)
{
   if (m_ReactorDisabled)
       return;
   // your code
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 09:06:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9707743#M4227</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-08-24T09:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: CAD collapse while closing if I create a CDocument in CAD winFrame</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9714050#M4228</link>
      <description>&lt;P&gt;the reason seems to be the conflict between the view of dwg and&amp;nbsp; the CDocument created by myself, so I have a try to delete&amp;nbsp; the view of CDocuement&amp;nbsp;created by myself in CommandWllStart(Quit) , which solve the crash problem&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&amp;nbsp; thanks anyway&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 01:10:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/cad-collapse-while-closing-if-i-create-a-cdocument-in-cad/m-p/9714050#M4228</guid>
      <dc:creator>27925916</dc:creator>
      <dc:date>2020-08-27T01:10:05Z</dc:date>
    </item>
  </channel>
</rss>

