I met someone asking SafeArray before, I just tested how I was interested in how the COM component returned in VB Script.
IDE is used by VC7.1
Starting almost, establishing an engineering, establishing a COM object, establishing a method:
Interface definition:
[ID (2), Helpstring ("Method getArray")] HRESULT GETARRAY1 ([OUT, RETVAL] VARIANT * V);
Method Implementation: STDMETHODIMP CATL3 :: GetArray1 (Variant * Pvavariant) {std :: vector Note that in the VBS or other script environments, you have to get the returning array parameters, and the types in the array are Variant Types. VBS test script DIM V4 CNX4.Add 1, 2 v4 = cnxn4.GetArray1 () DIM X For x = lbound (v4) to Ubound (V4) MSGBOX V4 (X) Next