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

synchronous to asynchronous DLL (Mapkey)

Eike_Hauptmann
12-Amethyst

synchronous to asynchronous DLL (Mapkey)

Hi @ all,


I search for a solution to run Mapkeys (with press of the "OK"-button, and every other thing) in a DLL.


Till now I have read the manual and understand (hope thats right), that I only can run mapkeys with complete functionality in async dlls. So I try to change my sync dll to an async dll. I changed the lib from protk_dll.lib to pt_asyncrounus.lib and try to make a simple connection to Pro Engineer, but I've get everytime a PRO_TK_GENERAL_ERROR ... I think I have a failure in my compile settings.


I've Compile my code as C - Code and Link with the following libs.


libs: pt_asynchronous.lib protoolkit.lib wsock32.lib +std. Libs


Everything seems alright.


After that I use the protk.dat :


name Model_Processor
startup dll
exec_file C:\WF4Test\MDLPRC_Runner.dll
text_dir C:\WF4Test\
allow_stop true
delay_start false
end


to load the DLL and get the failure. I think that could be the error too. But I didn't find a solution to load the DLL on another way.


I have a user_initialize and a user_terminate function inside so it should find them


#ifdef __cplusplus
extern "C"
#endif
int user_initialize(int argc, char *argv[])
{
char *pre = "Pre", *post = "Post";
ProError err;
uiCmdCmdId cmd_id;

ProTKFprintf(stderr, "\n<mdlprc> user_initialize\n");
/*------------------------------------------------------------------*\
Parse the command line
\*------------------------------------------------------------------*/
ProUtilCommandLineParse( argc, argv );

/*------------------------------------------------------------------*\
Initialize termination notification function.
\*------------------------------------------------------------------*/
err = ProTermFuncSet((ProTerminationAction)UserTerminateAction);
TEST_CALL_REPORT("ProTermFuncSet()",
"user_initialize()", err, err != PRO_TK_NO_ERROR);



I've copied for first tests the demo example inside my code. I've Compile with C std. so I've changed the extern "C" to only be compiled with C++ ... so never. Can be that this is the failure ...


Hope someone had the same quest already solved and give me a tip that show me a way to the solution of these problem.



Best regards,


Eike


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





> Till now I have read the manual and understand (hope thats right), that
> I only can run mapkeys with complete functionality in async dlls. So I
> try to change my sync dll to an async dll.


Asynchronous apps must be standalone executables. You
can't use a DLL only, although your async .exe can itself
use DLL's of course.




Marc
--
Marc Mettes

Thx very much is a step in the right direction.


Now I can start the exe file and say that it should connect to Pro/Engineer. The result is that Pro/E Crashes, but its a step.


Best regards,


Eike

Announcements