Its easy, just change the string. It will be marshalled back to VB properly:-
c++ Code:
// void _stdcall ReadVB6StringArray(SAFEARRAY **strings) { SAFEARRAY* vbarray =(*strings); ULONG numElements = vbarray->rgsabound[0].cElements; LONG lbound = vbarray->rgsabound[0].lLbound; char** vbStrings=(char**) vbarray->pvData; // Loops through the strings for(int i=lbound; (i < lbound+numElements);i++) { //Gets the current string char* current = vbStrings[i]; //Changes the strings in the array to //uppercase. The changes will be reflected //back in VB if (current != NULL){ strupr(current);} } }




Reply With Quote