我正在为Adobe Acrobat编写一个插件,遇到一些问题,我正在设置AVAppOpenDialog变量的对话实现
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**这是我的设置方法.即使该文件名为 file.jpg ,它有时也会显示不同的名称,例如 A9R5D8F.tmp 或只是不起作用.我怀疑我没有正确设置变量,但是当您不知道什么地方出问题时,黑匣子测试非常困难.谁能从下面的代码中看到我可能做错了什么
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`
根据Acrobat API,
是路径名数组.因此,对于初学者来说,您需要使用数组而不是ASPathName的地址.
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.
第二,您需要确保分配此数组内存,否则将引发异常.数组的大小为1.
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);然后您可以填充
**outASPathNames = asPathName更多推荐
为Acrobat对话返回值设置outASPathNames
发布评论