The example to make the dll call work in vb is like this:
sAnswer = oleOldObject.Request(Array("CODEZ", "LARRY", "JONES", "00"))
The interop has described the method this way:
public abstract new System.Object Request ( System.Object sMessages )
It shows up in code as "Request(ref object)"
I've tried to pass an array everry which way but loose in C#:
Array arrInput = null;
arrInput.SetValue("CODEZ", 0);
arrInput.SetValue("LARRY", 1);
arrInput.SetValue("JONES", 2);
arrInput.SetValue("00", 3);
sAnswer = oleOldObject.Request(ref (object)arrInput);
Produces error:
"A ref or out argument must be an lvalue"
OR
string[] arrInput = {"CODEZ", "LARRY", "JONES", "00};
sAnswer = oleOldObject.Request(ref arrInput);
Produces errors:
1) The best overloaded method match for Object1.oleOldObject.Request(ref
object)' has some invalid arguments.
2) Argument '1': cannot convert from 'ref string[]' to 'ref object'
Mattias Sj?gren - 05 Dec 2004 12:03 GMT
Jeff,
Try this:
object arrInput = new string[] {"CODEZ", "LARRY", "JONES", "00"};
sAnswer = oleOldObject.Request(ref arrInput);
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jeff - 11 Dec 2004 00:26 GMT
That worked fine, thanks to you, Merry Xmas, Happy Hanukah, etc.

Signature
Jeff
> Jeff,
>
[quoted text clipped - 4 lines]
>
> Mattias
Suri - 13 Dec 2004 14:34 GMT
If the retuen value is also an array, they how would I go about. I have tried with the
object sAnswer = string[]
Doesn't workout. Eve
object sAnswer = string[2]
and Message.Show(sAnswer[0]); fails. I am interested in getting the output element for further parsing
Any help is appreciated. Thanks in advanc