VB6.0 Component in VB.NET

r-S

Member
Joined
Dec 10, 2004
Messages
7
Location
England
Hi everyone!

I have an OCX that a friend wrote for me, and Ive used it for a long time in VB6.0, however Ive just hade the move to .NET and was wondering if I can still use this .OCX?

Ive added it to my project, and I can use its functions just fine (its not a visual component, mind), but it has an event which I am unsure how to use it -

In VB6, the sub for this event looks like this:
Code:
 Private Sub svrConnect(ByVal sData As String, ByVal lDataLength As Long, ByVal sSender As String, ByVal lSenderLength As Long)

However the same sub in VB.NET looks like this:
Code:
 Private Sub svrConnect_svrCommand(ByVal sender As System.Object, ByVal e As AxSVRCONNECTLib._DsvrConnectEvents_svrConnectEvent) Handles svrConnect.svrCommand

As you can see, the VB6.0 version gives me "sData", "lDataLength", "sSender" and "lSenderLength" to work with. Whereas in the .NET version, I only have "sender" and "e".

Does this mean the component will not work in VB.NET, or is there anything Im missing? (unfortunately the source is no longer availible, sorry)

Thankyou for your time :)

 
PlausiblyDamp said:
you can access the parameters via e.

e.g. you should be able to use e.sSender etc.
Ah, great stuff!
So simple... I guess theres a lot more things like this that Ill have to get used to from 6.0 to .NET :)

Thanks a lot PlausiblyDamp, Ill try that now ;)

*edit*
...and it works perfectly, thankyou!
 
Back
Top