Hello,
I am trying to do some late binding to an COM-Server.
Now I have the following problem: The IDL-Description of the Method looks
like this:
VARIANT_BOOL StartObjectQuery(
long ObjectType,
long* TotalNoOfObjects);
Now I try to execute this method with the following C# code:
int totalNoOfObjects = 0;
int objType = 1;
ParameterModifier pm = new ParameterModifier(2);
pm[0] = false;
pm[1] = true;
ParameterModifier [] pmArray = { pm };
object res = iobusQuery.GetType().InvokeMember(
"StartObjectQuery",
BindingFlags.InvokeMethod,
null,
iobusQuery,
new object[2] {objType, totalNoOfObjects},
pmArray,
null,
null);
return Convert.ToBoolean(res);
It executes without exception, but the "totalNoOfObjects" is always
unchanged!!!
How can I get the correct value?
Any help is appreciated!

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jochen Kalmbach - 24 Nov 2004 20:36 GMT
Sorry,
I found it out...
I need to use an args array
object [] args = {objType, totalNoOfObjects};
> object res = iobusQuery.GetType().InvokeMember(
> "StartObjectQuery",
[quoted text clipped - 5 lines]
> null,
> null);
and then it is in the array:
totalNoOfObjects = Convert.ToInt32(args[1]);

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/