.NET / COM event compatibility

I have an interop assembly generated by TlbImp.exe, the classes generated are very different and performance is very important.

But there is a problem, events seem to be logged / unregistered / called in such a way that even empty event handlers are counted. Given event set 1..N , when you register event handler 3 it looks like this:

{dummy1, dummy2, eventHandler3, dummy4 ... dummyN}

      

Which generates a lot of overhead when there are a lot of events that happen very often.

So the question is, is there a better way to deal with COM events in .NET? Any tool or something or do I need to rewrite the interop assembly event code from scratch?

0


source to share


2 answers


Solved with custom Advise

/ Unadvise

callbakcs.



0


source


Why not just let .NET build interop by executing a Using statement?

No events should be raised unless you explicitly set them.

Example:



http://code.msdn.microsoft.com/SEHE

As you can see, the above example sets up a lot of events.

0


source







All Articles