Working with ByRef parameters in COM.
From: Tim Tyannikov (timofeyt_at_hotmail.com)
Date: 08/24/04
- Next message: Brian Reed: "RE: Convert Int32 to Byte[] (UCOMIStream::Write)"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: Short[6] to string"
- Messages sorted by: [ date ] [ thread ]
Date: 24 Aug 2004 16:26:29 -0700
I have a test class called RefTest in TestByRef project. The class
has only one method:
Public Sub Sub1(ByRef x As String)
x = "asdf"
End Sub
In my test C# project I have:
Type t = Type.GetTypeFromProgID("TestByRef.RefTest", true);
object test = Activator.CreateInstance(t);
object [] args = new object[1]{null};
test.GetType()
.InvokeMember("Sub1"
, System.Reflection.BindingFlags.InvokeMethod
,null,test, args);
txtTestMethodResult.Text = args[0].ToString();
This code does not take me anywhere. The value of args[0] is always
null; not "asdf" as I expect.
Can somebody please tell me what is it that I am doing wrong?
Thank you,
Tim.
- Next message: Brian Reed: "RE: Convert Int32 to Byte[] (UCOMIStream::Write)"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: Short[6] to string"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|