Skip to main content
10-Marble
August 10, 2026
Question

ProEngineerConnect issue

  • August 10, 2026
  • 6 replies
  • 165 views

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
August 11, 2026

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

RPN
18-Opal
August 12, 2026

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.

JC_IN_KC10-MarbleAuthor
10-Marble
August 13, 2026

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.

RPN
18-Opal
August 15, 2026

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

ProEventProcess( void );

ProEngineerStatusGet( void );

In your loop?

JC_IN_KC10-MarbleAuthor
10-Marble
August 17, 2026

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

RPN
18-Opal
August 18, 2026

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.