Skip to main content
10-Marble
Aug 10, 2026 4:05 PM UTC
Question

ProEngineerConnect issue

I have code that I have written in C using the toolkit on Creo Parametric 12.4.3.0.  It tries to connect to Creo using ProEngineerConnect(), and it works fine if Creo is up.  When Creo is not running it returns a PRO_TK_E_NOT_FOUND value, which is expected.  If I have the call to ProEngineerConnect in a for-loop my executable dies after the third try when Creo is not running.  Here is the call:

iStatus = ProEngineerConnect("",NULL,NULL,"",PRO_B_TRUE,10U,&bRandom,&hSession);

This code worked just fine using Creo 10, but is failing under Creo 12.  I am using VS 2022.

 

6 replies

JC_IN_KC10-MarbleAuthor
10-Marble
Aug 11, 2026 1:46 PM UTC

Here is a simple code example of what I’m referring to.  The third time through the loop the executable returns to the system.

Translate
RPN
18-Opal
Aug 12, 2026 12:47 PM UTC

If you search this customization thread you will find multiple answers. But make sure the env var pointing to common message is properly set. A better way is to automate this in your code, by getting the path to the exe by searching within the running pids and set this before connecting.

Translate
JC_IN_KC10-MarbleAuthor
10-Marble
Aug 13, 2026 4:38 PM UTC

Thank you for your reply.

I have searched, but I’m not seeing anything that addresses my problem.  The env variable (PRO_COMM_MSG_EXE) is fine as it connects when Creo is up.  I have also printed it out to make sure that it isn’t going away somehow.  This same functionality worked fine in Creo 10.

Translate
RPN
18-Opal
Aug 15, 2026 2:36 PM UTC

Sorry I’m currently not able to open the zip, but are you using

ProEventProcess( void );

ProEngineerStatusGet( void );

In your loop?

Translate
JC_IN_KC10-MarbleAuthor
10-Marble
Aug 17, 2026 2:06 PM UTC

I have tried ProEventProcess(), but it didn’t change anything.  I have attached my code.

Translate
RPN
18-Opal
Aug 18, 2026 10:36 AM UTC

Ok, but for me this loop doesn’t make sense. You need to call this at the beginning, if you don’t have your own event loop, you need to call EventProcess from time to time, better is a timer in a different thread which call this. And you need to check if Creo is still running. After connect you can just call any other toolkit function. 

Translate