still looking for real solution to VBScript->C# array params
From: Christopher Robert (chrislrobert_at_hotmail.com)
Date: 06/06/04
- Next message: Scott R. Grabowski: "Re: OCR in MODI.Document Class in Office 2003"
- Previous message: Colin Priest: "Re: passing a bitmap to a runtime DLL using GDI+"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 6 Jun 2004 19:07:57 +0700
This problem appears to be common, but I haven't yet seen a real solution:
you want to pass an array from VBScript into a C#-built COM object. People
say to declare the incoming array param as an object rather than an array --
but when you do so (either "object" or "ref object") you're treated to a
curious "variable uses an automation type not supported in VBScript" error.
If you go with "object[]" or "string[]" you get "invalid procedure call or
argument" instead.
Kudos to Odie for discovering that an extra pair of ()'s around the
parameter on the VBscript side gets around the error. Kudos also to
Alexander for determining that passing an Array(x,y,z) parameter somehow
works too. Both good finds, but unfortunately not helpful for my case.
I'm porting a component to C# and need to be able to drop it onto existing
servers and have existing ASP code work as-is. So I can't change how the
VBScript code is structured. I need my wonderful new C# component to be able
to deal with the array as it's passed in. Doesn't seem unreasonable. Can
anybody tell me how to do that?
Thanks very much,
Christopher Robert
PS: It was bad enough I had to change all of my string params to object
(followed by ToString()) in order to handle incoming strings. Looks like
everyone is having these problems and so it might be time for a good KB
article.
- Next message: Scott R. Grabowski: "Re: OCR in MODI.Document Class in Office 2003"
- Previous message: Colin Priest: "Re: passing a bitmap to a runtime DLL using GDI+"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|