0

I have a windows form application which is basically a PDF viewer. I used the Adobe PDF Viewer COM component for this project.

The program works but I'm having an issue when I click the close button on the top right of the form after I open a pdf file. When I click the close button, VS does not exit the 'run'-mode and I have to manually click the 'stop' button on VS. And when I press the stop button, a window pops saying "vshost32 has stopped working".

However, this does not happen when I run the application and close it without opening a pdf file.

Any idea why this happens?

aresz
  • 2,589
  • 6
  • 34
  • 51
  • `VS does not exit the 'run'-mode and I have to manually click the 'stop' button ` This means that Process is still running. I mean you will be having some other ForeGround threads running. – Sriram Sakthivel Aug 21 '13 at 17:57
  • @SriramSakthivel My project has no more than one thread as far as I know. I just used the adobe pdf viewer component and dragged that to my winform. In addition to that, I only have two buttons, one to open a pdf file, and one to exit the application. – aresz Aug 22 '13 at 20:48

2 Answers2

0

You may have manually release the COM object by using Marshal. See this link: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.releasecomobject.aspx

0

The vshost32.exe is related to designer-simulation tasks in window forms, so try creating a new project then improt your classes from the old one.

Ramy Yousef
  • 2,982
  • 2
  • 25
  • 24
  • Hi, I tried recreating the project. But it is still giving me the 'vshost32 has stopped working' window – aresz Aug 22 '13 at 20:45