Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to catch Unhandled exceptions in Add-In

1 REPLY 1
Reply
Message 1 of 2
waterboarer
358 Views, 1 Reply

How to catch Unhandled exceptions in Add-In

Hello All,

 

I'm trying to figure out how to catch unhandled exceptions in my add-in. Can anyone provide some sample code on where the definitions are placed? I'm also trying to log these exceptions to view later in the windows Event Viewer)

 

This is all an attempt to find out why my add-in has crashed another users instance of Inventor with no warning (naturally, all works fine on my machine)

 

The examples I've found so far cover windows form applications, but not class library objects.

 

Thanks,

John

1 REPLY 1
Message 2 of 2
Ralf_Krieg
in reply to: waterboarer

Hello

 

Include your code in a try-catch construct, so you can see the exception as it appears.

 

Try

    'here comes your code

Catch ex As Exception
            MessageBox(ex.Message & vbNewLine & vbNewLine & ex.ToString)

End Try

 

I don't know how to give these exceptions to windows eventlog. Maybe you can write your own logfile. Take a look at his example http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report