Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Dll Task Execution

williaps

New member
All,


Does anyone know how to execute a function from a dll that was loaded by ProE at startup? More specifically, how do I get a ProToolkitDllHandle of a synchronous application that my program didn't start (ProE did)? I tried calling ProToolkitDllLoad (which returns me PRO_TK_E_FOUND because it is already loaded) but it doesn't initialize the dll handle. Does anyone know how to do this?
 
Hi William,


I am kishore V.I saw your issue in MCAD Central....I am also facing same technical problem using Pro-Toolkit. Do you got any solution in this regard.


Plz help me.


Kishore v


V.kishore babu
 
Here is the solution,


Publish the dll ID of the program that you want to utilize. I recommend creating a registry key. Then in your program you will have to read this key in order to get the dll ID and can then call functions from the other dll.
 
Hi William,


I am trying to understand your solution.But as per the Pro-Toolkit...The API for the DLL Load, you need to get the DLL Handle. But it is not able to load first in the Toolkit application.Can you tell me are they are not going to help directly to get Handle of the DLL?


As you suggested creating registry key...etc.I never work around those...


I will send my sample still it is not able to load the DLL first in the other toolkit application.I think calling the function is second issue for us.I hope if you can able to Load DLL successfully then half of the work is over.


I am sending two smple babu.zip is toolkit application.


kris.zip is the dll.


I think you know the steps to copy the dll and lib into your debug directory where your application runs.


2006-03-04_005410_babu.zip2006-03-04_005431_kris.zip


Kishore V
 
Hi Kishore V,
If you don't wan to use registry, you can write the ProToolkitDllHandle to a text file in temp directory for example. Simply call ProToolkitDllIdGet(NULL, application_id) and write the application_id (ProName) to that text file. Then you are able to use it from another application.
 
_TL_ has got the correct idea. In order to use any function from dll_A in dll_B, dll_B must have the application id of dll_A. Therefore, dll_A MUST publish it's application id in some form so dll_B can use it to call dll_A functions. My previous message suggested the registry but _TL_'s suggestion of a text file is just as valid. You may also do it in shared memory but that can get complicated.
 
Hi Williams,


I understand few things from your help.But one things is not clear.As per my code...i couldn't able to Load my Dll in Pro-Toolkit application fisrt.


I think there are two issues finally


1.Load the DLL in to Pro-Toolkit application


2.Try to call the function in the DLL from application.


I am not able to load my dll into application....the application name is showing in the auxillary window ..but it is state is NotRunning.


Plz give your feedbackwhat is wrong in that.


Kishore V
 
kishorev - All of this stuff only deals with accessing a Toolkit app that you didn't start. If you did start it - using ProToolkitDllLoad - then you already have the ability to execute it's functions. pwilliams original question was about executing a function from a DLL that you didn't explicitly load. It looks like your problem is just that you can't get ProToolkitDllLoad to work with your DLL.
 
Hi bruppert,


I could able to load my Pro-Toolkit dll into my another Toolkit application successfully. Now i could able to call the dll function ino my application..it is working fine. The arguments which i am passing is not able to take into function..eg.i passed one interger value to the function...using ProArgument object...the value in the dll is showing Zero. The value has not able to modify with the function.


I am not able to trace the problem where it is wrong.


With regards


Kishore v
 
Hi williaps & bruppert,


Thank you very much for your support for DLL ...


Finally i could able to load and successuflly able to call the function in the dll...I am able to pass arguments into ..function.


Thank you


Kishore V
 
Hi,


You can also export the "to be called" function in the "source" DLL, and link the "caller" DLL against this "source" DLL.


--


George
 
Hi George,





I didn't get you...Plz explain what you intended to say.


I recently tried to made a function call from DLL into Toolkit application.





With regards


Kishore V
 
Hi,


i able to load the dll from protoolkit using loadprotoolkitdll.


but my requirment is like this


1. i need to create a Menu in Pro-e [this is done]


2.Load some menu options to existing like file, edit just an example created using vb.net [this is done]


3.Load Pro tool kit dll's and add the same to the created Menu


Plz help
 

Sponsor

Articles From 3DCAD World

Back
Top