Event in interface

  • Thread starter Thread starter Wernfried Schwenkner
  • Start date Start date
W

Wernfried Schwenkner

I have the following problem while using events. The event is used in
two assemblies (remoting). Therfore I defined an interface assembly with
the event. One assembly is written in C# the otherone in managed C++.

Now, when I write the interface in C# I can't compile the C++-assembly,
getting an error that the signature of the event doesn't match with the
one declared in the C++-class.

Vice versa, writing the interface in in C++, I get a warning in the C#-
assembly, telling the same. While ignoring this warning all seems to
work perfectly. Can anyone point me what the reason to this behaviour
is? It seems for me, in C++ there will be generated three methodes (add,
remove and rise) for the __event-statement. In C# it works another way
and so the signature is another one.
 
Can you use ildasm to look at the method signatures for the event methods to
see whether they differ between the C++ and C# versions?

Ronald Laeremans
Visual C++ team
 
Can you use ildasm to look at the method signatures for the event methods to
see whether they differ between the C++ and C# versions?

Thanks for Your hint. Unfortunatly it will take a little time to check
this.
 
Back
Top