Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

vb.net to existing vb6 application - how to pass in object type variable (non referenced from vb6 project)

$
0
0

I have a vb.net application that I need to pass in a late bound object (the class is declared with COM) into a vb6 dll.

When trying to do so I get a Type Mismatch error.  If I change the vb6 parameters to a variant the Type Mismatch will go away but I cannot use the object as the intended class (it's a variant and not an object).

Is there a way to pass a COM vb.net class late bound into a vb6 dll?

Here is what a call in the vb6 DLL looks like

Public sub DoMyThing(pobjMyLateBoundDotNetClass as object)

in the vb.net project:

Public Sub CallVB6Routine

Dim objDoSomething AS vb6dll.clsDoSometing

Dim pobjMyLateBoundDotNetClass as clsMyLateBoundDotNetClass 

objDoSomething.DoMyThing(pobjMyLateBoundDotNetClass)

End Sub

clsMyLateBoundDotNetClass is a class declared as COM compatible

Also Create Object doesnt seem to work (this is how it used to work when all the apps were in VB6)

PS Yes the VB6 dll will be re-written into vb.net but trying to make a deadline with another feature and do not have time to convert yet.

Thanks!


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>