检索(的结构)从COM对象SAFEARRAY我试图引用定义为一个COM对象的方法:如何通过的ColdFusion 9
IEdmFile7::GetDerivedBOMs
Returns the derived (a.k.a. "named" or "saved") bills of materials associated with this file.
Prototype:
HRESULT GetDerivedBOMs([out,ref] SAFEARRAY (struct EdmBomInfo) *ppoBoms);
我在edmFile变量到IEdmFile7对象的引用。
当我<cfdump var="#edmFile#">
方法是可见的:
Method: GetDerivedBOMs([out]USERDEFINED, [out, retval]VOID)
当我尝试调用方法(曾试图通过许多不同PARAM类型):
<cfset edmFile.GetDerivedBOMs(???)>
它的错误与AutomationException: Member not found
。我只能假定它不能正确识别或投射参数。我如何正确地将一个引用传递给safearray(的结构体)?
(编辑从评论)
什么,我已经尝试了一些例子:
<cfset myObject = createObject("java","java.lang.Object").init()>
<cfset myArray = arrayNew(1)>
<cfset myRefArrayOfObjects = javaCast("java.lang.Object[]", myArray)>
<cfset myResultArray = edmFile.GetDerivedBOMs(myRefArrayOfObjects)>
结果:
Member Not Found Description: Automation Exception: Member Not Found
从注释中的另一种尝试:
<cfset myArray = ArrayNew(1)>
<cfset myArray = edmFile.GetDerivedBOMs()>
结果:
There are no methods with the specified method name and argument types.
Check your function and retry
如果您可以向我们显示您尝试过的调用和参数以及每个产生的错误,这将有所帮助。你有没有尝试用你的例子设置一个变量?像'',然后转储'edmResult'变量。 –
2013-02-12 21:09:03
在重读您的示例时,为什么要将任何内容传递给该方法? safearray参数仅被标记为输出。对?所以,你是否试过'然后''然后转储'myArray'变量。 –
2013-02-12 21:24:06
Miguel-F:我尝试过所有可能的事情,我无法发布em全部...您的建议(即然后)返回:“There没有指定方法名和参数类型的方法检查你的函数,然后重试“ –
2013-02-13 20:42:56