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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Translate the entire conversation x

Get the Dll Handle for multiple Addin

Praveen2
10-Marble

Get the Dll Handle for multiple Addin

wanted to know if it's possible to get the dll handle of another application from a toolkit application if both the applications are registered using registry file Prodev.dat.

 

Scenario: Suppose I am loading two add-in/plug-in DLLs at a time through prodev.dat file.
Internally, i want to get the handle of each DLL, to communicate internally.
Is there a way, i can get the DLL handle of each plug-in.

Steps tried: Suppose, I am loading A.dll and B.dll through prodev.dat.
When both gets loaded, I called toolkit API ProToolkitDllLoad() and passed B.dll path to get the B's handle.
But, the API fails.
If I try to call, ProToolkitDllHandleGet() , I don't have the first argument i.e. ProName application_id
Query from PTC team: Is there a way, i can get the Handle of B's DLL?

5 REPLIES 5
RPN
17-Peridot
17-Peridot
(To:Praveen2)

Maybe be I’m wrong here, but if both dll’s are loaded, they already share the same namespace in Creo. And you can try to call exported functions. Do you want to call functions without linking on build?

Praveen2
10-Marble
(To:RPN)

Yes, they are not linked during build.

RPN
17-Peridot
17-Peridot
(To:Praveen2)

Ok and how to you implement signature check of the calls and arguments? Do you want to import later. I think if the function in the other DLL is exported you can call it in your code if this is linked with the lib, else I'm out here 🙂

Praveen2
10-Marble
(To:RPN)

ok, we call using the ProToolkitTaskExecute function, so it provides some abstraction. Also both the add-ins are independent add-ins for which we do not want to create a linking dependency

RPN
17-Peridot
17-Peridot
(To:Praveen2)

But in this case I don't understand your initial question. If the DLL is loaded after start by Creo, the OS should know about. 

 

Else check ProToolkitDLL.h here is maybe all you need:

 

ProToolkitDllLoad

ProToolkitDllIdGet

ProToolkitDllHandleGet

ProToolkitTaskExecute

ProToolkitDllUnload

...

Announcements

Top Tags