getting an event handler from a active-x dll dispinterface
- From: HanslH <no@xxxxx>
- Date: Mon, 25 Dec 2006 00:11:37 +0100
I have imported a active-x dll into delphi for communicating with a
device trough com-port.
I managed to create an object with a sendmessage procedure and used it
succesfully. I now want to create events to receive messages but since
I only know for about 10% what i'm doing I don't know where to start.
Also I signed a non-disclosure contract with the firm of the device so
I can't be too specific I guess.
The sendmessage is formulated in a class in the wrapper something
like this
========================================
iMachineprotocol = interface(lDispatch);
['{blabla}']
function SendMessage(var Data: OleVariant): SND_STATUS; safecall;
function OpenPort(const bstrPortName: WideString): INIT_STATUS;
dispid 4;
function GetMessage: OleVariant; dispid 7;
MachineProtocol = class
class function Create:iMachineProtocol;
========================================
I can create an object
o := machineprotocol.create;
And use this object to open the comport and send byte-array
transformed to olevariant messages.
The device responds happily
But I can't GET messages, I would need an event handler for that I
guess.
The events-object(?) is formulated in the wrapper something like this:
=======================================
SomelEvents = dispinterface
['{blablabla}']
procedure Youhaveamessage; dispid 1;
end;
========================================
How do I use this in delphi?
I use delphi 4
.
- Follow-Ups:
- Re: getting an event handler from a active-x dll dispinterface
- From: Marc Rohloff
- Re: getting an event handler from a active-x dll dispinterface
- From: Maarten Wiltink
- Re: getting an event handler from a active-x dll dispinterface
- Prev by Date: Re: local to screen
- Next by Date: Re: local to screen
- Previous by thread: local to screen
- Next by thread: Re: getting an event handler from a active-x dll dispinterface
- Index(es):