Hi everyone,
I'm writing a C#.net app that is controlling an automation server.
Added a reference to the COM server.
Have the interop wrapper classes generated.
Have the following code to instantiate the COM server and to attach to
the event:
........
obj = new ABCClass();
obj.OnUserClosed += new
ABCClassEvents_OnUserClosedEventHandler(this.ABCUs erClosed);
......
Everything compiles and runs OK.
I'm able to execute methods and access properties of the COM object.
The event handler got called correctly too.
My problem is if I attach more than one events like below:
........
obj = new ABCClass();
obj.OnUserClosed += new
ABCClassEvents_OnUserClosedEventHandler(this.ABCUs erClosed);
obj.OnFormSaved += new
ABCClassEvents_OnFormSavedEventHandler(this.ABCFor mSaved);
......
I will get a COMException during runtime. Now, I have 4 events need to
handle. I have tested each of them. Each works correctly individually
and got called, but I cannot able to attach more than one event. Any
ideas?
Thanks!
Ducky