我试图引用定义为的 COM 对象方法:
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)
当我尝试调用该方法时(尝试传递许多不同的参数类型):
<cfset edmFile.GetDerivedBOMs(???)>
它与AutomationException: Member not found
. 我只能假设它没有正确识别或投射参数。如何正确地将安全数组(结构)的引用传递给方法?
(根据评论编辑)
我尝试过的一些示例:
<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