Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everyone!

 

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

 

I've added it to my project, and I can use it's functions just fine (it's 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:

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:

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 I'm missing? (unfortunately the source is no longer availible, sorry)

 

Thankyou for your time :)

Posted
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 there's a lot more things like this that I'll have to get used to from 6.0 to .NET :)

 

Thanks a lot PlausiblyDamp, I'll try that now ;)

 

*edit*

...and it works perfectly, thankyou!

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...