cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to implement exception handling for ProToolkit API's?

stripathy-2
4-Participant

How to implement exception handling for ProToolkit API's?

How to implement exception handling for ProToolkit API's so as to avoid Creo crashing when we pass invalid input arguments?


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
ACCEPTED SOLUTION

Accepted Solutions

There is only a exception handling in OTK, inside of TK Exception Handling AFAIK is not possible.

But you can build up you Application as an asynchronous one and that shouldn't pull down creo if it get crashed.

Inside of a scnchronous application often not the TK Command crashes directly with the wrong input. But you read and write to memory cells that's not allowed and if you explicit cast things thats not checkable from the compiler.

Br,

Eike

View solution in original post

3 REPLIES 3

There is only a exception handling in OTK, inside of TK Exception Handling AFAIK is not possible.

But you can build up you Application as an asynchronous one and that shouldn't pull down creo if it get crashed.

Inside of a scnchronous application often not the TK Command crashes directly with the wrong input. But you read and write to memory cells that's not allowed and if you explicit cast things thats not checkable from the compiler.

Br,

Eike

Thanks Eike.Appreciate it.

sully7
14-Alexandrite
(To:stripathy-2)

While compiling in Visual Studio, I have been wrapping most of the Pro/TOOLKIT functions. For example: 

ProError my_function () {

  __try {

     // some code 

  } __catch (EXCEPTION_EXECUTE_HANDLER) {

     // some more code

  }

  return PRO_TK_NO_ERROR;

}

Its probably not the best thing to do from a "coding best-practice" standpoint... but its saved my Creo sessions from crashing, and helped me debug

President & Founder
CadActive Technologies - www.cadactive.com
Announcements


Top Tags