I'm having some confusion trying to access pAdditionalFileNames in the function below. Basically I have been passing that function as shown:
Code:
wstring additions[3];
additions[0] = L"black.dll";
additions[1] = L"white.dll";
additions[2] = L"yellow.dll";
//additions[3] = L"green.dll";
PdfPrnInstCopyDriverFilesExW(L"E:\\test",
L"E:\\Research\\Hello",
(const WCHAR**) additions,
sizeof(additions));
into the function as shown:
Code:
BOOL someFunc(const WCHAR* destFolder, const WCHAR* pSourceFolder, const WCHAR** pAdditionalFileNames, size_t nAdditionalFileNamesSize)
{
// Determine amount of additional files passed to the function by
// dividing the amount of bytes needed by amount of bytes per entry (32 bytes/entry)
size_t nEntries = nAdditionalFileNamesSize/32;
wcout << "nAdditionalFileNamesSize = " << nAdditionalFileNamesSize << endl;
/*wstring *pAddFileNamesStrings = (wstring*) pAdditionalFileNames;
for (int i=1; i < 5; i++)
{
wcout << "file " << i << " = " << *pAddFileNamesStrings << endl;
pAddFileNamesStrings++;
}*/
return TRUE;
}
I have tried the code highlighted in green to address the pointer to pointer, however, it seems that I am not addressing the memory properly, hence runtime errors during testing. Does anyone have pointers on ways to obtain the contents of pAdditionalFileNames? Thanks.