?
Solved

Event handling in DLL

Posted on 1998-06-29
6
Medium Priority
?
155 Views
Last Modified: 2010-04-04
Maybe I'm just being obtuse:

If I call a function in a DLL that should return an integer and that function uses a process that requires event handling how do I return the result?

For example: my actual function takes some information, massages it, opens a socket connection to a service, writes the data, and receives a response.  That response needs to be returned to the calling application.  However, when I get the response, I'm in the onDataArrival event handler -- far removed from my original function.

How can I return that value?

Any thoughts?

Thanks
- Frank
0
Comment
Question by:FBlair
[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
  • 4
  • 2
6 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1356349
You can send messages between Main Application and DLL and then use the event OnGetMyMessage... or something similar. Is this approach good for you?
If yes, Let me know and I'll post some example.
0
 

Author Comment

by:FBlair
ID: 1356350
Sounds easy enough, but how would that work if the DLL is in Delphi and the calling program is in, say VB?
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1356351
It doesn't matter, you send messages "to the Handle" of a program, so if you are writing the other program in VB you should see it's documentation on handeling messages.
0
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!

 
LVL 5

Expert Comment

by:ronit051397
ID: 1356352
in the DLL you write somethong like:
sendmessage(Handle which is the Handle of the VB program, WM_MYMESSAGE, here you write the Integer value, 0);

On the VB program you write an event which handles the messages coming to your program.

Or use DDE...
0
 

Author Comment

by:FBlair
ID: 1356353
Cool.  I think I have the idea.  If you'll make it an official answer, I'll take it.

Thanks.
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 400 total points
ID: 1356354
OK.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

771 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