Code Comments
Programming Forum and web based access to our favorite programming groups.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.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.