Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Be Event Driven From a DLL

Status
Not open for further replies.

bebbo

Programmer
Dec 5, 2000
621
GB
A external person is writing a DLL file in C++ for me to use in Visual Fxopro. I know I can include this file in my project no problem. I also know I can use the Functions just like any other functions. My question is how can my program be event driven from that dll file.

I've asked this question previously regarding "AddressOf", a keyword in Visual Basic. A number of people have tried to help but I'm stugling.

Basically the external program is controling two devices which things can be inserted. I can open these devices by using the functions, no problem. However the external program now wants to be event driven and send me info when things are inserted. Has anyone got any suggestions on how we can do this.

I thought about the external device writing to a file or perhaps a registry "??????" Then I could look for info in this mannor. However is there any other way we could achieve this. Something to do with callback??? or pointers.

As you will probably realise this is new terriorty to me. any help/suggestions will be greatly recieved.

Thanks


 
If you have them create a COM dll (as opposed to what is sometimes referred to as a "c dll") then you would be able to create objects in VFP and the DLL would handle all of the internals. Furthermore, if you look up EventHandler() in the VFP help file I think you'll start to get an idea of how you could then bind (read intercept or alerted) to the events raised by the COM object. This is about as close as you are going to get with VFP.

It's pretty slick, in fact when you get the DLL from whoever is coding it you can drag-and-drop the interface(s) from the VFP object browser into a prg file and it will create the basic outline of the class/procedures needed to properly implement it for you.

Slighthaze = NULL
craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top