I have a vb6 function like this
Public Sub Init( Parent )
Set mparent = Parent
End Sub
from vb.net I call it like this
Dim util As New example.dbUtil
util.Init( Nothing )
The vb6 com object fails. Using the vb6 debugger I can see that the
value of Parent is empty and not Nothing. If I change the type of
Parent to an actual object (as shown below) then the function works
and the debugger shows the value is actually nothing as it should be.
The actual code expects Parent to be an object but it can be several
different types which is why the type is left off. We have lots of
code that works this way. How can I pass Nothing from vb.net to vb6
and have it really mean nothing as opposed to empty?
Public Sub Init( Parent As dbUtil )
Set mparent = Parent
End Sub
Christian Fröschlin - 27 Sep 2004 09:12 GMT
> I have a vb6 function like this
>
[quoted text clipped - 4 lines]
> The actual code expects Parent to be an object but it can be several
> different types which is why the type is left off.
The above declaration actually translates to
Public Sub Init(ByRef Parent As Variant)
You might wish to use
Public Sub Init(ByVal Parent As Object)