Cool. Let me try that. I tried overriding but the compiler complained with
the following error:
COM Interop registration failed. Type library exporter encountered an error
while processing 'WeedPlugin1.CWeedPlugin.add_MapSet(value), WeedPlugin1'.
Error: Type library exporter can not load type MapSetEventHandler (error:
System.TypeLoadException: Could not load type MapSetEventHandler from
assembly DotNetPlugin, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=968e71ee5ce24c2c.).
As you can see, the event handler is MapSetEventHandler.
I'll see if it works the other way and let you know. Thanks for your help
btw.
Steve
Noah Coad said:
Simple, just like this in the inherited class:
base.MapSet += new EventHandler(this.MapSetFunction)
Where "EventHandler" is the delegate that is specified for the MapSet event
and "MapSetFunction") is the method you wish the event to raise. The
"base." is not required if you are not overriding the event with a new
event.
-Noah Coad
Microsoft MVP & MCP [.NET/C#]
Steve Long said:
Hello,
I have a VB.NET class that raises a MapSet event that passes an
argument
of
type interop.MapObjects2.MapClass.
I have a C# class that inherits from this VB.NET class. How can I
handle
the
VB.NET event in the C# class?
In VB.NET, you would just write:
Handles MyBase.MapSet
I would appreciate any help on this.
Steve