How do I exit a Multiple Solution VB program?

How do I exit a Multiple Solution VB program?

Anonymous
Not applicable
522 Views
4 Replies
Message 1 of 5

How do I exit a Multiple Solution VB program?

Anonymous
Not applicable
I have a multiple solution VB 2005 program that uses the ActiveX/COM interface in AutoCAD 2007. Everything works as expected, except that I don't know how to gracefully exit the VB program after everything is finished. Here is a copy of the program that I am running:

>CommandMethod("Run", CommandFlags.Session)> _
Public Sub Run()
CreateDrawing()
ThisDrawing.Close
ThisDrawing.Application.Quit
' How do I exit the VB program after this?
End Sub

Can somebody please tell me what I need to do to gracefully exit the VB program after everything has finished? I tried Application.Exit, but that doesn't work.
0 Likes
523 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
What do you mean by 'exit' ?

Your solution is loaded into AutoCAD, and you
can't 'exit' it.

It will remaind loaded until AutoCAD shuts down.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5499492@discussion.autodesk.com...
I have a multiple solution VB 2005 program that uses the ActiveX/COM interface in AutoCAD 2007. Everything works as expected, except that I don't know how to gracefully exit the VB program after everything is finished. Here is a copy of the program that I am running:

>CommandMethod("Run", CommandFlags.Session)> _
Public Sub Run()
CreateDrawing()
ThisDrawing.Close
ThisDrawing.Application.Quit
' How do I exit the VB program after this?
End Sub

Can somebody please tell me what I need to do to gracefully exit the VB program after everything has finished? I tried Application.Exit, but that doesn't work.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thanks for your prompt reply. Perhaps what I should have asked is "How do I shut down AutoCAD without getting the following error:"

"Windows has triggered a breakpoint in acad.exe. This may be due to a corruption of the heap, and indicate a bug in acad.exe or any of the dlls it has loaded."

It would appear to me that I need to have something after

ThisDrawing.Application.Quit

so that AutoCAD shuts down without Windows flagging an error, but I don't know what. I tried application.exit, but that didn't work.
0 Likes
Message 4 of 5

Anonymous
Not applicable
Tony:

Thanks for your help. I realize now what I was doing wrong. I was invoking AutoCAD from within Visual Studio, then I would quit AutoCAD, but Visual Studio was still in the picture. I guess what I was trying to find out is how to exit Visual Studio after exiting AutoCAD. Anyway, if I load the dll independently from Visual Studio everything works as expected, so that is what I'll do from now on.

Thanks again for your help.
0 Likes
Message 5 of 5

Anonymous
Not applicable
Sorry, I haven't tried to quit AutoCAD from
an external client, so I have no idea why its
failing like that.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5499829@discussion.autodesk.com...
Thanks for your prompt reply. Perhaps what I should have asked is "How do I shut down AutoCAD without getting the following error:"

"Windows has triggered a breakpoint in acad.exe. This may be due to a corruption of the heap, and indicate a bug in acad.exe or any of the dlls it has loaded."

It would appear to me that I need to have something after

ThisDrawing.Application.Quit

so that AutoCAD shuts down without Windows flagging an error, but I don't know what. I tried application.exit, but that didn't work.
0 Likes