5 Replies Latest reply on Apr 16, 2012 11:38 PM by lrosenth

    Plugin WindowsForm not closing before Acrobat window closes


      I have a plugin that I am building that opens a Windows Form, lets the user check some stuff/do some calculations and then send a block of text to the PDF.

      The problem is that if the user does not close the Windows Form before closing the main acrobat window, the program will crash due to a access violation in reading a memory location.  The problem does not happen if the windows form is closed first and then the main acrobat window is closed.



      1. user opens a document

      2. User launches the window form using the plugin

      3. User does some work using the document and the windows

      4. User is done so they close the acrobat window

      5. User sees that the windows form is open still and closes it.

      6. Error happens



      I create the windows form using Application::Run(gcnew Form1());

      In the windows form, I added this function:


      public: static void ExitCalc(){


      This function is called in the .cpp file that generates the dropdown menu as part of the PluginUnload but the problem stays.

      I need to close the windows form object before the acrobat window closes.


      Thanks for the help.