110,549
社区成员
发帖
与我相关
我的任务
分享
[DllImport("yourdll.dll")]
public static extern void Test(ref string ch1,ref string ch2);
private void TestDLL()
{
string sg1,sg2;
sg1="AAA";
sg2="BBB";
Test(ref sg1,ref sg2);
MessageBox.Show(sg2);//这里显示“BBB”不对,我的DLL返回是123456}
}
[DllImport("yourdll.dll")]
public static extern void Test(ref string ch1,ref string ch2);
//错误1与“Test(ref string ch1,ref string ch2)”最匹配的重载方法具有一些无效参数
[DllImport("yourdll.dll",CallingConvention=CallingConvention.Cdecl)]
public static extern void Test(string ch1,StringBuilder ch2);
[DllImport("yourdll.dll")]
public static extern void Test(ref string ch1,ref string ch2);
//错误1与“Test(ref string ch1,ref string ch2)”最匹配的重载方法具有一些无效参数
[DllImport("yourdll.dll")]
public static extern void Test(ref string ch1,ref string ch2);
[DllImport("yourdll.dll")]
public static extern void Test(string ch1,string ch2);
private void TestDLL()
{
string sg1,sg2;
sg1="AAA";
sg2="BBB";
Test(sg1,sg2);
MessageBox.Show(sg2);//这里显示“BBB”不对,我的DLL返回是123456}
[DllImport("yourdll.dll")]
public static extern void Test(string ch1,string ch2);