r-S Posted December 11, 2004 Posted December 11, 2004 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 :) Quote
Administrators PlausiblyDamp Posted December 11, 2004 Administrators Posted December 11, 2004 you can access the parameters via e. e.g. you should be able to use e.sSender etc. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
r-S Posted December 11, 2004 Author Posted December 11, 2004 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! Quote
Recommended Posts