On 21 Feb, 12:47, "Jim Andersen" <nos...@nospam.dk> wrote:
> I have this piece of code I am trying to convert from c# to vb.net.
> It's a Windows project.
>
> This line gives me trouble ( I have tried to compress the code for
> readability. Hope I haven't screwed up):
> m_CA.AnEvent += new U.U_EventHandler(evt);
>
> I assume this is a c# way of adding an additional eventhandler to an event?
>
> If I move this over to VB, I get an error at "AnEvent", and at "evt"
> The AnEvent error is "....Can't call directly. Use RaiseEvent...".
> The evt error is "....use addressof..."
>
> I don't know if the following information is useful.
> At the top of the code is
> private U.CC m_CA = null;
>
> and then there is a sub with
> m_CA = new U.CC();
> m_CA.AnEvent += new U.U_EventHandler(evt);
>
> And then there is this sub
> private void evt(byte id, string data){......}
>
> somewhere inside U is
> public virtual event U_EventHandler AnEvent;
>
> tia
> /jim
Hi
Something like "AddHandler m_CA.AnEvent, AddressOf evt" ?
|