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 so as to avoid Creo crashing when we pass invalid input arguments?
Solved! Go to Solution.
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
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.
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