EPDM Addin works only in Debug Mode

I'm done debugging, now I deploy.  The custom functions show on the right click menu, but some don't run.  How do I now debug since the addin runs perfectly in the debug mode?

I've been in and out of the debug mode successfully for some time now, so this is not new to me.  But the problem certainly is.  The only difference is that my addin now references the SolidWorks Document Manager.

Any suggestions?  Can I debug the addin in "Live" mode somehow?

Kent

SolidworksApi macros
Answers 5
WM
WM 2011-05-18 Best Answer

That is strange that it runs OK in debug mode, but not in normal mode.

No you cannot debug when in normal mode. You will need to put in some try and catch error checking or remove the add-in and add it back in debug mode.

FV
FV 2011-05-18

Hi Kent, adding to Wayne's suggestion...what I do in cases like that is create a dynamic form with a textbox or something, just for printing out debug values. Then you would make some method that would take some text as an argument and display it in the textbox. So instead of debug.print for example, you would call that method throughtout your code, to make sure things are running the way they should. When something is missing, then you can start narrowing the gap down....pretty messy, but it gets the job done.

Hope this helps

Cheers

KK
KK 2011-05-18

What is wierd, is that messageboxes will not even display for that particular function.  The messageboxes will appear in debug mode only.  Perhaps I need to open a log file and write to it with the code status from time to time.  Other functions within the addin work fine.  I have seen this type of behavior with the Document Manager API before (even in debug mode) where I can't even step into the code if there is any reference to Document Manager inside the sub or function.

I feel like my hands are tied to finish this app on time. :S

Kent

KK
KK 2011-05-18

I found a solution(s)

Rebuild the app as opposed to simple build.

Remove the old addin

Log out of EPDM completely

Restart Explorer

Add in the Addin to EPDM though administrator

Retest the app.

'VBScript Code to Restart Explorer

'Stop Explorer
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'Explorer.exe'")
For Each objProcess in colProcessList
    objProcess.Terminate()
Next

'msgbox "Explorer should be stopped at this point"

'Start Explorer
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2:Win32_Process")
Error = objWMIService.Create("Explorer.exe", null, null, intProcessID)

FV
FV 2011-05-19

Wow, that's odd...glad you figured it out though...

Cheers