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.
=====================================================