
Raising events in a object modell
Hello,
I'm building an object model for my application so that it can expose it and
let me and other users write COM Plug-ins for it. Defining and exposing the
object model isnt any problem, until I want to raise events.
I have tried defning my object model interfaces in DLL's and then implement
them in the host application and I have written the interfaces in IDL and
compiled into a TypeLib which I have referenced and implemented in my
host application.
In both cases I cant use the RaiseEvent command to fire of events in my
object model. I can declare objects from the object modle WithEvents to
write event handelrs but I cant raise the events. In the IDL test I placed
the
events in a dispinterface and combined the interface & evebts in a coclass
like I know it should.
I really dont want to use a "fake" way of using an FireEvent method that
raises events in the interfaces and I dont want to use a callback interface
if i _really really really_ dont have to, since I want to expose an object
model that follows the normal way (for example like the entire office
suite does).
I have looked at Eduardo Morcillas COM Events example on how to hook
up my interfaces with IConnectionPoints and shift vTabels etc to raise the
events but if _possible_ then I would like to stay away from 3rd party
code and be dependent of the author - the code is very advanced and
would require the OLELIB.TLB that Eduardo has written.
I'm all for using API etc if it can help me solve this problem. As it is
now, I
cant write plugins etc for my application without any problem but I cant
trigger my events - I need the events inorder to make the object model
a decent one.
Please dont suggest swapping the events into subs or functions, since thats
just "an easy way" and doesnt really solve the problems.
bye =)