سؤال

I am writing a plug-in for Adobe Acrobat and having some issues I am setting my dialogues implementation of AVAppOpenDialog variable

*outASPathNames

in the code at the bottom. It says in the method that this variable is a

ASPathName**

Here is how I am setting it. Even though the file is called file.jpg it sometimes shows different names like A9R5D8F.tmp or just not work. I suspect I am not setting the variable correctly, but black box testing is very hard when you don't get told what is wrong. Can anyone see from the code below what I might be doing wrong

ASPathName asPathName;
char *filePath = "C:\\Test\\file1.jpg";
ASFile asFile;
ASPathName* arrays[] = {&asPathName};


asPathName = ASFileSysCreatePathFromDIPath(0, filePath, 0);
ASFileSysOpenFile64(0, asPathName, ASFILE_READ, (ASFile *)&asFile);


*outASPathNames = &asPathName;
هل كانت مفيدة؟

المحلول

`*outASPathNames`

according to the Acrobat API is an array of pathnames. So for starters you need to use an array not an address of an ASPathName.

Secondly, you need to make sure you allocate this array memory or you will get thrown exceptions. 1 here is the size of the array.

*outASPathNames = (ASPathName*)ASmalloc(sizeof(ASPathName) * 1);

Then you can populate

**outASPathNames = asPathName
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top