Re: getting an event handler from a active-x dll dispinterface



"HanslH" <no@xxxxx> wrote in message
news:201uo25ruadn1ck40tbknkui1aaj6i7m1s@xxxxxxxxxx
[...]
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?

You write your own class that implements this interface, create an
instance of it, and register it with the object abstracting the
device through its interface.

When the device object wants to fire an event, it calls the
'YouHaveAMessage' method through the interface reference you
gave it.

It's not very different from having a component class and setting
an event handler (a property) to a method reference in probably your
form class, only _everything_ is done through interfaces. That way,
your (and their) classes don't need to derive from known base classes.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: High performance alternative to MI of virtual bases
    ... > been to simply define an interface as an ABC as described below. ... > were always abstract base classes. ... > commonly called ABCs (Abstract Base Classes): ... > class that exclusively has pure virtual functions. ...
    (comp.lang.cpp)
  • Re: High performance alternative to MI of virtual bases
    ... > it inherits from multiple base classes instead of simply 4 bytes which is ... I am not saying that Dr. Stroustrup is incorrect, ... > using the more concerete defintion of interface as per what we are seeing ... Pure Abstract Base Classes are based on the ...
    (comp.lang.cpp)
  • Re: kobj multiple inheritance
    ... The kobj lookup scheme doesn't require any kind of locked memory ... >> This proposed scheme also traverses through base classes of base classes ... >> Interface lookup using current kobj can be done expliticly. ... The cache is large even ...
    (freebsd-arch)
  • Re: Abstract Base Classes vs Interfaces?
    ... >one would chose an interface and reject an abstract class and vice-versa. ... >>> without necessarily providing them with a DLL or a concrete class from ... if you implement a .Net plugin architecture you deliver a DLL with your ... This works identically with abstract base classes as well. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Beginner, Which language
    ... > That's much more true for implementation inheritance than interface ... > compared to the run time support Java requires. ... > - All base classes of the interface must also be declared with interface ...
    (comp.programming)