Solved

Bind dll functions to runtime object events.

Posted on 2000-03-23
5
239 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
  • 3
5 Comments
 

Expert Comment

by:Carpathia
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now