G
Guest
I have a static event declared in a C++ ref class, that can then be handled
in a VB app. I'm trying to expose the static event through the interface
that the C++ ref class implements so the VB app can use the interface as
preferred. How do you expose a static event through an interface?
In the example below as coded, in a VB app I can access and use the general
method (MyMethod) if I declare my handle variable as an IMyInterface type. I
can also use the general method and handle the event in VB if I declare as a
CMyClass. I cannot however seem to expose the static event through the
interface IMyInterface; any ideas?
public interface class IMyInterface
{
void MyMethod();
// delegate void EventHandler(const long lVal, bool% bVal); - WONT COMPILE
// static event EventHandler^ OnEventPost; - WONT COMPILE
};
public ref class CMyClass : IMyInterface
{
CMyClass();
~CMyClass();
virtual void MyMethod();
delegate void EventHandler(const long lVal, bool% bVal);
static event EventHandler^ OnEventPost;
};
Thanks
in a VB app. I'm trying to expose the static event through the interface
that the C++ ref class implements so the VB app can use the interface as
preferred. How do you expose a static event through an interface?
In the example below as coded, in a VB app I can access and use the general
method (MyMethod) if I declare my handle variable as an IMyInterface type. I
can also use the general method and handle the event in VB if I declare as a
CMyClass. I cannot however seem to expose the static event through the
interface IMyInterface; any ideas?
public interface class IMyInterface
{
void MyMethod();
// delegate void EventHandler(const long lVal, bool% bVal); - WONT COMPILE
// static event EventHandler^ OnEventPost; - WONT COMPILE
};
public ref class CMyClass : IMyInterface
{
CMyClass();
~CMyClass();
virtual void MyMethod();
delegate void EventHandler(const long lVal, bool% bVal);
static event EventHandler^ OnEventPost;
};
Thanks