Solved

Bind dll functions to runtime object events.

Posted on 2000-03-23
5
249 Views
Last Modified: 2010-04-04
I'm creating a runtime object into a
library (dll).
This object has an "xxx" type event :
i want to assign this event to a function contained into the library.
How can I define this new function to be binded to the "xxx" event?
I don't have classes into this library (dll).
0
Comment
Question by:Geppo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 

Expert Comment

by:Carpathia
ID: 2651346
You can get the address of each function within your DLL by using GetProcAddress, (and LoadLibrary if needed).

Once you have this address, you can typecast it to the type of event you are wanting to call. You may have to place this into a temporary event variable before assigning this event to the event property.

Hope this helps :)

0
 

Author Comment

by:Geppo
ID: 2659915
I can't use GetProcAddress because the function itself is defined into my library.
I can get the address of my function with the @operator, but i can't typecast it to my type event (a procedure of object).

Thanks for your help.
0
 

Author Comment

by:Geppo
ID: 2659917
I can't use GetProcAddress because the function itself is defined into my library.
I can get the address of my function with the @operator, but i can't typecast it to my type event (a procedure of object).

Thanks for your help.
0
 

Author Comment

by:Geppo
ID: 2663104
I can't use the Getprocaddress into my Library: the runtime object is created into the dll.

Also, i can't typecast my function to the type event, it doesn't work.
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 2886930
Sorry, you can't do this. The reason is because you can only export functions/propcedures from a DLL, not events. You will need to create a normal event handler in your application which then calls the appropriate procedure in the DLL.

Cheers,

Raymond.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question