Thanks John, I hadn't realised types behaved differently. To be honest, I've never come across an object that behaves ByVal in VB6. Obviously I know the base data types like string, long etc do, but then they're not objects! Still, I keep learning.
Now I know VB.Net behaves in this way, I...
Ah... thanks for the reply, and I agree that the behaviour is the same. A lack of research on my part is to blame, sorry about that.
However, now I'm more confused. I originally tried this with a string variable rather than a SqlCommand and the behaviour is different. If you switch all...
Let explain with a bit of code, first the VB6 version:
Class - Class1.cls
Private mCmd As Command
Public Property Get Cmd() As Command
Set Cmd = mCmd
End Property
Public Property Set Cmd(pCmd As Command)
Set mCmd = pCmd
End Property
Module - Main.bas...
Hi, I'm new to VB.Net after years of VB5/6 development, so please forgive what might be a bit of a stupid question.
We're all familiar with the Property Set functionality in VB6 which works ByReference.
I've just found today that in VB.Net that you cannot pass an object to a property set...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.