Raising events in a object modell 
Author Message
 Raising events in a object modell


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
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 =)

Mon, 02 Feb 2004 23:04:42 GMT  
 [ 1 post ] 

 Relevant Pages 

1. how to raise base class event and method from the derived child object

2. Raising events from objects in a collection

3. Raising events from objects in a collection

4. Raising events from objects in a collection

5. Browser Object Not Raising DocumentComplete Event

6. Objects in Collection and Raise Events

7. Raising events from collection member objects?!?!

8. Debugging Events raised by C++ objects hosted in vb

9. Raise Event or CallBack Object?

10. Pass object or Raise Event?

11. Raising events from objects in a collection???

12. Raising events from objects in a collection???


Powered by phpBB® Forum Software