Day of the Developer

Living the life of a developer. What is development work really like?

<August 2006>
SuMoTuWeThFrSa
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

Post Categories

Article Categories

News

I'm a dad :) Welcome to a new life.

Navigation

Software Business Tips

My Sites

Subscriptions



Lovely COM InterOp Errors

The following error was encountered: One or more arguments are invalid.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) at HelperClass.AgentContainerList(String strUSER, String strPASSWORD, String Port, String FromDate, String ToDate, String ContainerNo, Boolean& Success, String& ErrorMsg) in D:\inetpub\externalDev\HelperClass.vb:line 679

I have a COM DLL I am using via InterOp.  On a W2K server, it's fine.

On the new W2K3 server, it's not.

ALMOST all the method calls work fine.

A couple take DateTime or NULL/NOTHING passed in as an object for one or more parameters.

When called with NULL/NOTHING, still fine.

When called with a DateTime, BANG.  I get the error at the top of the page.

I haven't managed to find anything helpful on Google, so I'm going to post stuff here as I work it out.

=====================================================

OK.  The entire list of parameters for the function are variants.  Not a good idea in my opinion
but I didn't write it.

I got the creator to test it, and he sent me a sample that "worked for him" in VB 6.  His sample
used strings instead of dates, and when I tried that in .NET it worked.

So, it looks to me like there is an issue in passing DateTime values as variants, but given that it
worked on the W2K server, it seems specific to W2K3. 

=====================================================

posted on Friday, August 25, 2006 2:17 PM by admin

Powered by Community Server, by Telligent Systems