Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bind dll functions to runtime object events.

Posted on 2000-03-23
5
Medium Priority
?
254 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

704 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