C++ Programming
10-23-2009, 06:30 AM
SAFEARRAY* arr;
int iRes = RestoreFactory(bstrPath, // this function is for c#com object &arr);
// Copy SAFEARRAY* values to output
int iSize;
if ( arr != NULL )
{
iSize = arr->rgsabound[0].cElements;
BYTE *byteArr = new BYTE[iSize];
for (int i = 0; i < iSize; i++)
{
byteArr[i] = ((BYTE)((( char *)(*arr).pvData)[i]));
}
}
The byteArr seems to be wrong!
Is it the right convertion???
Thanks!
int iRes = RestoreFactory(bstrPath, // this function is for c#com object &arr);
// Copy SAFEARRAY* values to output
int iSize;
if ( arr != NULL )
{
iSize = arr->rgsabound[0].cElements;
BYTE *byteArr = new BYTE[iSize];
for (int i = 0; i < iSize; i++)
{
byteArr[i] = ((BYTE)((( char *)(*arr).pvData)[i]));
}
}
The byteArr seems to be wrong!
Is it the right convertion???
Thanks!