Anirban
August 30th, 2001, 08:22 PM
Hi All,
I would like to use a COM component that is written in C++ from VB code. The idl looks like this,
-----
library Myib
{
....
....
interface IFoo:IDispatch
{
HRESULT FooBar([in] IMyInterface* Item);
};
...
coclass MyObj
{
[default] interface IFoo;
};
};
----
In the VB code, I do this:
---
Dim lPI As IMyInterface
Set myVar = New MyLib.MyObj
Dim v As Variant
v = lPI
myVar.FooBar(v)
----
All I get here is that v as a VT_BSTR (in the C++ side). Is there any way of packing Variant v as an varObj instead of default string? If not, what is the best way to send something that corresponds to IMyInterface* in the C++ side?
Thanks much.
-Anirban.
I would like to use a COM component that is written in C++ from VB code. The idl looks like this,
-----
library Myib
{
....
....
interface IFoo:IDispatch
{
HRESULT FooBar([in] IMyInterface* Item);
};
...
coclass MyObj
{
[default] interface IFoo;
};
};
----
In the VB code, I do this:
---
Dim lPI As IMyInterface
Set myVar = New MyLib.MyObj
Dim v As Variant
v = lPI
myVar.FooBar(v)
----
All I get here is that v as a VT_BSTR (in the C++ side). Is there any way of packing Variant v as an varObj instead of default string? If not, what is the best way to send something that corresponds to IMyInterface* in the C++ side?
Thanks much.
-Anirban.