Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations LittleInch on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ProToolkit Application Using MFC

  • Thread starter Thread starter anil963
  • Start date Start date
A

anil963

Guest
Hi All,


I am unable to Open ProE Session (Using MFC). I have create one push button and try to Open ProE session.


Thanks in Advance
 
Anil,


Maybe you can be more specific in whatyour problem. Posting some code would be very helpful as well. Otherwise, we may not be able to help you.
 
Yes, what do you mean by open ProE session? You can connect to session by Pro/Toolkit, but as williaps said, it will be good to describe it more and provide problematic part of code.

Regards
 
Hi Williaps,


I have using dotnet 2003, and ProE version 3.0.I want to create a MFC Application with button when i click on that butoon it will invoke ProE session, It will connect with the existing ProE session Open. When I use system command it work fine. But when I use ProEngineerStart it is not working.


void CShaft1Dlg::OnBnClickedButton1()
{



//system ("D:\\EngApps\\ptc\\WF3\\bin\\proe1.bat");
if(ProEngineerStart ("D:\\EngApps\\ptc\\WF3\\bin\\proe.exe",NULL)
!= PRO_TK_NO_ERROR)
{
printf("Could not connect to, or start, Pro/ENGINEER\n");
return;
}
}


extern "C" int user_initialize ()
{
MessageBox(NULL, "Pro/Toolkit App", "proe", MB_OK);
return 0;
}


extern "C" void user_terminate()
{
return;
}
 
You need to define the PRO_COMM_MSG_EXE environment variable before you launch a session of Pro/ENGINEER. Here is some example code that launches a session of Pro/ENGINEER connected to a Pro/INTRALINK workspace.


Code:
extern "C" ProError SetupProEnvironment() {


char szTemp[_MAX_PATH];


ProError pro_error = PRO_TK_NO_ERROR;


ProName pro_wszWsName;





//Setup Pro/ENGINEER environment variables


sprintf_s(szTemp, _countof(szTemp), "PRO_COMM_MSG_EXE=\"%s\"", g_szProCommMsgExe);


_putenv(szTemp);


sprintf_s(szTemp, _countof(szTemp), "PDM_LDB_PATH=%s\\%s", g_szInstallDir, ds_szTaskId);


_putenv(szTemp);





//Start Pro/ENGINEER 


pro_error = ProEngineerStart(g_szProBatchFile, NULL);


//Connect to the workspace 


ProStringToWstring(pro_wszWsName, "Workspace"); 


pro_error = ProWorkspaceRegister(pro_wszWsName);


return PRO_TK_NO_ERROR;


}
 
Hi


I already set PRO_COMM_MSG_EXE environment variable and it is working fine for Asynchronous console application. Basically I have to import a model into ProE and display it. After that i have to change the parameter(Dimension) etc. with my MFC form interactively.


Thanks
 
Hi All,


I want to create a user interface for a async toolkit application using MFC.Can anyone please help meto set up development environemnt.





Thanks in Advance,


Nandini.S.L
 

Part and Inventory Search

Sponsor

Back
Top