VB.net form application closes Inventor when shutting down

VB.net form application closes Inventor when shutting down

BromanSillito
Advocate Advocate
530 Views
3 Replies
Message 1 of 4

VB.net form application closes Inventor when shutting down

BromanSillito
Advocate
Advocate

I have written a program in VB.net with Inventor API functionality and have been developing it for some time now.  Recently when closing the VB.net application it also closes Inventor. Here's the call I use to close the VB.net application:

 

System.Windows.Forms.Application.Exit()

 

Can anyone tell me why it would close Inventor?  Do I need to release the Inventor.Application object in the closing function of my form?

 

 

0 Likes
531 Views
3 Replies
Replies (3)
Message 2 of 4

yan.gauthier
Advocate
Advocate

when you close a form, it try to close it's thread at the same time. since your form is declared on the Inventor thread, it closes Inventor.

 

How do you start your form ?

0 Likes
Message 3 of 4

BromanSillito
Advocate
Advocate

I don't believe that the form is loaded on an Inventor thread.  My program is a standard winform application, and is loaded before any Inventor threads. I have not touched the form designer file or the resx file.  I make the connection to Inventor using: "oInventorApp = Interaction.GetObject(, "Inventor.Application")", and it is made after the form is loaded.

 

0 Likes
Message 4 of 4

yan.gauthier
Advocate
Advocate

My guess would be that on closing your application, the code Dispose of you InvApp object. you should be able to debug your code and follow the closing event steps

0 Likes