Setting outASPathNames for Acrobat Dialogue return value

爷,独闯天下 提交于 2019-12-24 00:28:50

问题


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;

回答1:


`*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


来源:https://stackoverflow.com/questions/15635344/setting-outaspathnames-for-acrobat-dialogue-return-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!