c#怎么传string给c++编写的dll,dll参数为char*
2个回答
展开全部
dll 导出函数声明: int WINAPI open( char* name );
C#声明:
[DllImport("test.dll", EntryPoint = "open", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Winapi, ExactSpelling = false)]
public static extern int open(string chost);
C#调用:
string url = this.textBox1.Text; //控件的值
open( url );
C#声明:
[DllImport("test.dll", EntryPoint = "open", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Winapi, ExactSpelling = false)]
public static extern int open(string chost);
C#调用:
string url = this.textBox1.Text; //控件的值
open( url );
展开全部
dll 导出函数声明: int WINAPI open( char* name );
C#声明:
[DllImport("test.dll", EntryPoint = "open", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Winapi, ExactSpelling = false)]
public static extern int open(string chost);
C#调用:
string url = this.textBox1.Text; //控件的值
open( url );
C#声明:
[DllImport("test.dll", EntryPoint = "open", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Winapi, ExactSpelling = false)]
public static extern int open(string chost);
C#调用:
string url = this.textBox1.Text; //控件的值
open( url );
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询