tags:

views:

120

answers:

1

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() As String) As String
  AddNumbers = "hello"
End Function
A: 

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) );
Aaron Greenlee
Thanks for your suggestions. I have tried the first one before. The error thrown is : java.lang.ClassCastException: coldfusion.runtime.Array cannot be cast to java.lang.String. Your second suggestion throws the error :coldfusion.runtime.java.MethodSelectionException: The AddNumbers method was not found..probably because the method signature was not recognised. I also dumped the comobject variable just after it is created and this is the result (some lines ommitted):AddNumbers([out,in]I2, [out,in]BSTR, [out, retval]BSTR)notice that the second param is not recognised as an array.
yuben