c#调用vb 的dll,参数类型问题
vb编写的dll的函数原型为
Public Declare Function SetEditText(ByVal FCaption As String, ByVal Times As Long, ByVal dwspeed As Long) As Long
c#调用方式
[DllImport("xxx.dll")]
private static extern int SetEditText(string str, int times, int speed);
运行总是乱码,比如我传入“你好”,变成“扡摣e”,
求高手指点这里应该怎么写,非常感谢。
------解决方案--------------------COM
COM
VB的DLL是COM
------解决方案--------------------vb的string是unicode编码吗
------解决方案-------------------- System.Text.Encoding.GetEncoding("GB2312")
编码处理下吧