ColdFusion COM error
I am upgrading from CF4.5 to CF8. Calls to COM dll's that used to work in version 4.5 now throw a "Complex object types cannot be converted to simple values.." error. The COM object has a few arrays defined as output parameters. These variables are being defined as arrays in Coldfusion. Any idea as to what has changed in CF to cause this problem and what can I do to solve it?
EDIT:
This is the CF code:
Arg2 = ArrayNew(1);
answer = ComObject.Test(1,"Arg2"); <------This line throws the error
The VB ActiveX DLL code:
Public Function AddNumbers(number1 As Integer, ByRef Arg2() A开发者_如何学Cs String) As String
AddNumbers = "hello"
End Function
I suspect somewhere the array is being treated as a number or string. Without code examples, it will be difficult to provide any more assistance. You may want to check the treatment of an index when accessing positions in an array.
UPDATE
Try changing
answer = ComObject.Test(1,"Arg2");
To
answer = ComObject.Test(1,Arg2);
OR
answer = ComObject.Test(1,arrayToList(Arg2) );
精彩评论