English 中文(简体)
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() As 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) );




相关问题
How can i add a button to all windows explorer instances?

I am trying to add a button to one of the existing tool bars in any windows explorer instance. After much research i figured out that BHO (browser helper objects) are the best way to hook to ...

Hunting memory leaks

I m finding leaked heap blocks by using the following command in WinDbg !heap –l With each leaked heap block I get, I m running to following to get the stack trace. !heap -p -a leakedheapblock The ...

Why use CComBSTR instead of just passing a WCHAR*?

I m new to COM. What exactly is the advantage of replacing: L"String" with CComBSTR(L"String") I can see a changelist in the COM part of my .NET application where all strings are replaced in this ...

IThumbnailProvider and IInitializeWithItem

I am trying to develop an IThumbnailProvider for use in Windows 7. Since this particular thumbnail would also be dependant on some other files in the same directory, I need to use something other than ...

Getting a byte array from out of process C++ COM to C#

What s the best way to get a chunk of memory (i.e. void*) from a COM server to C#? We have been using an IStream (using CreateStreamOnHGlobal) and passing that back, which worked. However when we ...

COM Basic links

folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks

热门标签