Passing VARIANT array from VB to VC

narasani7478
narasani7478 used Ask the Experts™
on
I need to pass the VARIANT array from VB to VC ATL Dll.

I am trying to call the VC Dll from VB application, It is working fine when i early bind the VC dll ie by using the references and it is not working when i use the late binding ie when i use the CreateObject to instantiate the VC ATL DLL.

Can any one tell me the reason and the solution, i need to make it work with late binding.

Thankyou in advance...

Murali
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hi,
You will have to pass a safearray inside a variant structure. What I mean is this,

VARIANT vaArray;
vaArray.vt = VT_ARRAY | VT_ARRAY;
vaArray.parray = SafeArrayCreate(.......) etc.

Cheers,
VCStud

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial