日期:2014-05-17  浏览次数:20832 次

指针的问题!!!!!!
我遇到一个问题,详细代码如下:
 [DllImport("LClientDll.dll",EntryPoint="LClientStartDemo",ExactSpelling=false,CallingConvention=CallingConvention.Cdecl)]
        public static extern unsafe int LClientStartDemo(string host, string port, string oper, string ch, int flag);
        [DllImport("LClientDll.dll",EntryPoint="LClientRcvDemo",ExactSpelling=false,CallingConvention=CallingConvention.Cdecl)]
        public static extern unsafe int LClientRcvDemo(char *data);
        [DllImport("LClientDll.dll",EntryPoint="LClientStop",ExactSpelling=false,CallingConvention=CallingConvention.Cdecl)]
        public static extern int  LClientStop();
        public Form1()
        {
            InitializeComponent();
            

        }

        private void button1_Click(object sender, EventArgs e)
        { 
            
        
            int r = LClientStartDemo("127.0.0.1", "7628", "801", "0", 0);
            
           
           
        }
LClientRcvDemo(char *data)参数是指针我希望将值传递给一个变量然后进行进一步处理方案可行吗?具体如何操作?

------解决方案--------------------

[DllImport("LClientDll.dll")]
    public static extern int LClientStartDemo(string host, string port, string oper, string ch, int flag);