Reputation: 33
i'm working about OLE(COM) ,so that i want to convert string array to SAFEARRAY or CComSafeArray or COleSafeArray or VARIANT or COleVariant.
converted string array to SAFEARRAY or CComSafeArray or COleSafeArray or VARIANT or COleVariant is sended OLEMethod to do COM.
please help me
Upvotes: 3
Views: 2692
Reputation: 52461
CString strings[100];
CComSafeArray<BSTR> myArray(100);
for (int i = 0; i < 100; ++i) {
myArray.SetAt(i, strings[i].AllocSysString(), /*copy=*/ false);
}
Upvotes: 2