Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2004

Tip: Looking for answers? Try searching our database.

passing nothing from vb.net to vb6 com

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank - 25 Sep 2004 19:48 GMT
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)

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.