Solved

Bind dll functions to runtime object events.

Posted on 2000-03-23
5
248 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
How to call a form that is in a DLL  from an application? 13 95
Strange behavior when a form is closed 6 74
Adoquery sql  left join does not work 25 118
Base1 Encode/Decode 3 97
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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