Hi Mary,
I have been working with this issue and modified the code as suggested; the code is shown below:
First, the code which creates the array of string variables:
AnsiString filename0 = “c:\test\file1.pdf”;
AnsiString filename1 = “c:\test\file2.pdf”;
AnsiString filename2 = “c:\test\file3.pdf”;
AnsiString filenameout = “c:\test\fileAsposeOutConcatenateFilesCharArray3.pdf”;;
Variant array;
int bounds[2] = {0, 3};
array = VarArrayCreate(bounds, 1, varOleStr);
int i = 0;
VarArrayPut(array,filename0, &i, 0);
i = 1;
VarArrayPut(array,filename1, &i, 0);
i = 2;
VarArrayPut(array,filename2, &i, 0);
sesPdf.ConcatenateFilesTStringList2(array, filenameout);
Then, the method to call the Concatenate method in turn:
bool TSESPdf::ConcatenateFilesTStringList2(Variant array, AnsiString filenameout)
{
bool ret = false;
Variant vRet = m_vPdfFileEditor.OleFunction(“Concatenate”, array, filenameout.c_str());
return ret;
}
However, I'm getting the following exception when I execute the above code:
Project raised exception class EOleSysError with message 'No such interface supported'. It looks like the syntax is not correct for the string array parameter. As you know, Concatenate method takes string[] as first parameter. I have created Variant "array" as string array, but it is not correct. Could you please share your thoughts or confirm from Embarcadero about the syntax for the OleFunction where we have to pass a parameter like string[]?
The code works fine when we pass individual file names as string. So, I believe once we figure out the correct syntax for the other overload Concatenate(string[] , string), it'll be working fine as well.
We're sorry for the inconvenience and looking forward to help you out.
Regards,