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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

How to use the pfsession class?

wang666Tk
4-Participant

How to use the pfsession class?

Hi

Recently I have been learning Creo Toolkit.

I have some doubts about using ProToolkit and Creo Object Toolkit 

The development environment is VS2019 and Creo 9. As a beginner, I started learning the Protoolkit and later learned the Object Toolkit. I referred to the example code of PTC and found that there are exceptions when using interfaces that both exist. The Pro toolkit interface works properly, but the object toolkit interface may cause program crashes. Debug information output "Invalid parameter passed to C runtime function."

For example, when selecting model items interactively, the ProSelect() function in the toolkit interface works properly, while the pfcSession:: Select() function crashes when the cancel button is clicked; When displaying messages, the Toolkit interface ProMessage Display() function can function properly, while the object Toolkit interface pfcSession:: UIDisplayMessage will crash. Similar situations occur in interface functions such as pfcSession:: UIOpenFile(), pfcSession:: UISelectDirectory(), and pfcSession:: UISaveFile().

I suspect that I missed something during the  initialization phase of the pfsession object.

If anyone knows where the problem is or has encountered a similar problem, please help me

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

pfcSession:: Select() can throw exceptions from user actions:

pfcXToolkitUserAbort  - The user chose Quit.

pfcXToolkitPickAbove  - Selection was interrupted by a user's pick on any button from above menus.

 

Need code sample, exceptions names to understand your other cases.

View solution in original post

2 REPLIES 2

pfcSession:: Select() can throw exceptions from user actions:

pfcXToolkitUserAbort  - The user chose Quit.

pfcXToolkitPickAbove  - Selection was interrupted by a user's pick on any button from above menus.

 

Need code sample, exceptions names to understand your other cases.

wang666Tk
4-Participant
(To:YaroslavSin)

Thank you for your reply. I understand the problem. I did not handle any exceptions when using the object toolkit function

Top Tags