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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Connection issues in asynchronous app(makefile project)

ptc-3191571
1-Visitor

Connection issues in asynchronous app(makefile project)

Hello,

Ihad done necessary changes in sample makefiles available with proe installation & written a simple code which will start a new proe session(.c source code file).Thr was no issue in build I got my executable as well.When I am trying to execute it on windows command prompt I am continuously getting errors.

1st I got PRO_TK_APP_UNLOCK error then I unlocked the executable using protk_unlock.bat it passed thr this error but I dont its good practise to unlock executable each I debug my app.

Next when Idebug this unlocked executable it thrown an PRO_TK_GENERAL_ERROR.All the possible causes of this error like name service,pro_comm_msg_exe variable are removed.Still I am getting this error.Strange thing I can see xtop.exe in task manager for some seconds.Finally it returns with this error code.

Kindly help.

Rahul


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2
JamesKerkstra
5-Regular Member
(To:ptc-3191571)

Hello,

I am somewhatnew to toolkit programming buta couple suggestions since I have recently encounteredsimilar issues. First inyour proe1.psf file that is in your <prodir>/bin directory make sure the followingline is present

ENV=PROE_FEATURE_NAME=PROE_FlexEng (14)

This will checkout a toolkit license when you start proeand should eliminate the need to keep unlocking the toolkit applications.When you distribute the application you do need to unlock it so users can use the dll.

If you candebug into the user initialize function thenyour issue is more than likely with code. If you cannot you are more than likely have the wrong lib files linked or bad compiler settings. The most recent issue I had with my debugversion wasI had used the Multi-threaded Debug runtime library ( /MTd ) but was not linking protk_dllmd.lib and was instead linking in protk_dll.libwhich is only for if you use the Multi-Threaded flag ( /MT ).

Another trick is to put a message box on the top of the user initialize then if you see it come up you know that you are at least getting into the code. This will also allow you to connect to xtop and if you put a break point on the line immediately after you can debug this function.

extern "C" int user_initialize(int argc, char *argv[], char *szVersion, char *szBuild, wchar_t *wzErrBuf) {

MessageBox(NULL,"HELLO WORLD","HELLO WORLD",MB_OK);

}

Hope that helps, If someone has better tricks up their sleeves please correct me so I can learn too.

Jim,



In Reply to Rahul M.:

Hello,

Ihad done necessary changes in sample makefiles available with proe installation & written a simple code which will start a new proe session(.c source code file).Thr was no issue in build I got my executable as well.When I am trying to execute it on windows command prompt I am continuously getting errors.

1st I gotPRO_TK_APP_UNLOCK error then I unlocked the executable using protk_unlock.bat it passed thr this error but I dont its good practise to unlock executable each I debug my app.

Next when Idebug this unlocked executable it thrown an PRO_TK_GENERAL_ERROR.All the possible causes of this error like name service,pro_comm_msg_exe variable are removed.Still I am getting this error.Strange thing I can see xtop.exe in task manager for some seconds.Finally it returns with this error code.

Kindly help.

Rahul

Jim,
You are correct in your Runtime Library settings needing to be consistent
with the proper Pro/TOOLKIT library in the linker. Another way to debug
user_initialize is to start Pro/ENGINEER but don't allow your application
to start yet (in the registration file). Then attach to xtop.exe with
Visual Studio and set a breakpoint in the user_initialize function. Now
you can go back to Pro/ENGINEER and start your application through the
Auxiliary Applications dialog and your breakpoint should be hit
immediately. This allows you to debug that function without writing any
unnecessary code like the popup window.

Additionally, to further explain the psf contents... The
PROE_FEATURE_NAME is the variable that Pro/ENGINEER uses to retrieve
licenses. The PROE_FlexEng is the Pro/ENGINEER license and may be
different depending on what your company purchased. For example
PROE_Flex3C or PROE_Flex3CG are also valid entries for a Pro/ENGINEER
license. The number(s) in the parentheses (14) are additional options or
floating modules that are attached to that particular psf/startup command.
Number 14 is the identifier for Pro/TOOLKIT. When this option is
attached to your Pro/ENGINEER session you are able to execute an unlocked
Pro/TOOLKIT application for debugging purposes. Then as you correctly
stated you need to unlock the application before distributing it to users
via protk_unlock.bat.

Patrick Williams
Sr. Systems Engineer II
Mechanical Engineering Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (business)
+1 520.545.6399 (fax)
-

TU/M12/8
6221 S Palo Verde Rd
Tucson, AZ 85706 USA
www.raytheon.com



This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.



Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags