events in MC, C#

  • Thread starter Vladimir Scherbina Nickolaevich
  • Start date
V

Vladimir Scherbina Nickolaevich

hello all,
I need to hook some event handler in Managed C++code into event, that is
declared, and is fired in C# code.

as i understand, this maybe achieved via __hook, but when i write code like
this
__hook(&SomeControl::SomeEvent:, controlInstance,
&CSomeClass::EventHandler);



i get an error that the event handler method must have the same paremeters
as delegate.



my method's params are :

(System::Object __gc * sender, System::EventArgs __gc * e)

and the delegates:

(object sender, EventArgs e)

what can be wrong ?
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Vladimir,

Not sure here, may be the MC compiler expects the event argument pointers to
be "const" as soon as the C# declaration does not specify the event
arguments as "ref". You can re-post your question in a Managed C++ newsgroup
as it is more pertinent to MC rather then to C#.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top