List Info

Thread: C-Sharp (C#) Group: Re: VC++ activex event in C#




C-Sharp (C#) Group: Re: VC++ activex event in C#
user name
2005-12-29 23:35:59

dwaach wrote:

> Hi,
>
> I am one activex compoenent native.ocx.
> I have added one event.
> Now I am required to capture this event in the c#
application and I am
> trying to do this,
>
> is this correct,
>
> axnative1.onMessage +=new
>
AxNATIVELib._DnativeEvents_onMessageEventHandler(this,onMess
age);
>
> I get error where signature of onMessage() is
>
> void onMessage()
>
> Kindly help
>
> Regards,
> Dwaach

I am guessing (without knowing the signature of the
onMessage delegate)
that the event handler should look like this:

axnative1.onMessage +=new
 AxNATIVELib._DnativeEvents_onMessageEventHandler(onMessage)
;

When adding a handler to an event, you are just supplying
the address
of a method which has the required signature, so the
additional "this"
argument is not required

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )