Help with managed events in cpp


L

Lee Alexander

Because of a crappy bug (which I hoped would be fixed in 7.1) I have to use
an add / remove accessor for an event in a managed C++ class. The trouble
is that on the C# end it won't allow me to use += on the event.
"'CPPLib.SomeClass' does not contain a definition for 'SayHello'"

This is how I am declaring the events in my CPP class:

public:
static __event void add_SayHello(EventHandler * p)
{
Inner::SayHello += p;
}

static __event void remove_SayHello(EventHandler * p)
{
Inner::SayHello -= p;
}

static __event void raise_SayHello()
{
Inner::InvokeSayHello();
}


Any ideas would be welcome....


Regards
Lee.
 
Ad

Advertisements


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