现在DLL中定义的是WCHAR   我想问一下C#中怎么样把CHAR转换成WCHAR  我在网上查的  说他们是一样的  可是我直接传进去  报错  希望高手指点一下

解决方案 »

  1.   

    不知道这样 行不行, 你可以试试
    重载你wchar.dll里面的函数
    public class Wchar
    {
    [DllImport("wchar.dll", CharSet=CharSet.Ansi)]
    public static extern char xxxx();
    }
      

  2.   

    [DllImport("PathPicker.dll")]
    public static extern string ShowDialog(string a, string b, string c);        private void bShowFileDlg1_Click(object sender, EventArgs e)//按钮单击事件
            {
                string a = "文件显示";
                string b = "请选择同步文件夹";
                string c = "24";
                this.tServerPath.Text = serverpath = ShowDialog(a, b, c);//ShowDialog为dll中函数
            }