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

How to call a macro in the middle of a program?

SOLVED
Highlighted

How to call a macro in the middle of a program?

HI,

 

For synchronous toolkits, the macro is executed after the program function returns and a handle is returned to the creo.

 

Is there no way to use macros in the middle of a program in a synchronous toolkit?
Can you tell me if there is a way to use a macro in the middle of a program in a synchronous toolkit and run the handle back to the toolkit?

 

Since we did not find an API to extract the piping BOM, we need to extract the piping BOM using a macro.
For each model, you must extract all piping BOMs for each simplified representation.

 

If you know how to throw a macro in the middle of code in a synchronous toolkit and get back to the toolkit, Please let me know.

 

Thanks,

 

Warm Regards,
SeonHo

 

PS. attached photo was show what i need[ PIPING BOM]image_1.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to call a macro in the middle of a program?

There is no direct way to do this.

 

I found following work around:

Create separate toolkit DLL application which has macro execute code.

When you want to execute macro than load dll and call the required DLL methods.

 

This is like calling another application from your current application so that macro executes in sync.

API's which can help you are:

ProToolkitTaskExecute

 •ProToolkitDllLoad()
•ProToolkitTaskExecute()
•ProToolkitDllUnload()
•ProToolkitDllIdGet()
•ProToolkitDllHandleGet()

14 REPLIES 14

Re: How to call a macro in the middle of a program?

There is no direct way to do this.

 

I found following work around:

Create separate toolkit DLL application which has macro execute code.

When you want to execute macro than load dll and call the required DLL methods.

 

This is like calling another application from your current application so that macro executes in sync.

API's which can help you are:

ProToolkitTaskExecute

 •ProToolkitDllLoad()
•ProToolkitTaskExecute()
•ProToolkitDllUnload()
•ProToolkitDllIdGet()
•ProToolkitDllHandleGet()

Re: How to call a macro in the middle of a program?

Thank you for your reply.
But is not this about the interaction between J-Link and the C-Toolkit?
I have tested and return PRO_TK_E_NOT_FOUND

 

PS excute.c call other dll function.  basefunction.c has PRO_DLL_EXPORT function.

Re: How to call a macro in the middle of a program?

You are able to load "TASKTEST.dll" in Creo ?

 

after your method executes .. you can see the application  TEMPDLL in Auxiliary application. you should click on in and try to start. if you get any error in starting then you have some issue with DLL. May be the way its built.

Re: How to call a macro in the middle of a program?

Yes, I can load TASKTEST.dll in CREO.

If define function to menu in BASE_FUNCTOIN.c that function is work well.

Re: How to call a macro in the middle of a program?

What is the error you are facing now ?

 

Is function from DLL executing ?

Re: How to call a macro in the middle of a program?

ProToolkitTaskExecute was return -4(PRO_TK_E_NOT_FOUND)

Re: How to call a macro in the middle of a program?

This error is may be because of name mangling

 

use following macro to export method and try once.

#define EXPORT extern "C" __declspec(dllexport)

Re: How to call a macro in the middle of a program?

Sorry, it works!

Thanks a lot!!

 

is MAGIC LINE!!!!!!!!!!!!!

#define EXPORT extern "C" __declspec(dllexport)

Re: How to call a macro in the middle of a program?

Uhm... it works... but..

The macro does not run in the middle of the code.
The macro will run after all programs have finished.
regret...