Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass By Reference in C#
#7
Hi Gintaras,
Sorry to bother you again, but I've got this error "unknown member" for the following code, and I don't know why?
Macro StringTest
Code:
Copy      Help
out
str s1="s1"
str s2="s2"
str s3="s3"
CsScript cs.AddCode("")
IDispatch dp=cs.CreateObject("Test")
BSTR _s1=s1
BSTR _s2=s2
BSTR _s3=s3
dp.StringTest(&_s1 &_s2 &_s3)
err
,out _error.description
s1=_s1
s2=_s2
s3=_s3
out "s1 = %s, s2 = %s, s3 = %s" s1 s2 s3

#ret
//C# code
using System;

public class Test
{
,public static void StringTest(ref string x, ref string y, ref string z)
,{
,,x = "x_string";
,,y = "y_string";
,,z = "z_string";
,}
}


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)