[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Pass Array from VBScript to ActiveX (C++)

Asked by Mendota in ActiveX, Windows ATL / WTL / COM Programming, Microsoft Visual C++.Net

Tags: ActiveX

Greetings Experts!

I'm hoping someone can help me with an odd issue I'm having passing an array from VBScript to an ActiveX control.  I have no issues passing arrays back to VBScript but when I pass an array to the control I would expect a VT_ARRAY or VT_SAFEARRAY of BSTRs.  I am not seeing this and hence am unable to retrieve anything

IDL

[id(1), helpstring("method CreateArchive")] HRESULT CreateArchive([in] BSTR archive, [in] VARIANT fileList);

Method:
STDMETHODIMP CFoo::CreateArchive(BSTR archive, VARIANT fileList)
{
    if (fileList.vt == (VT_ARRAY | VT_BSTR))
    {
         OutputDebugString(L"Array Received");            
    }
    else
    {
         OutputDebugString(L"VARIANT type unexpected");
    }

    return S_OK;
}

VBScript

<script type="text/vbscript">
            Dim myArray(3)
            myArray(0) = "C:\File1"
            myArray(1) = "C:\File2"
            myArray(2) = "C:\File3"
            myArray(3) = "C:\File4"
           
            Foo.CreateArchive "FooZip.zip", myArray

        </script>

Any insight into what may be going on is appreciated.
[+][-]11/01/09 09:49 PM, ID: 25717261Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/01/09 10:04 PM, ID: 25717314Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/23/09 07:24 PM, ID: 25893843Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625