当前位置:编程学习 > C#/ASP.NET >>

高手帮忙看看

    C语言DLL中函数原形为 :int __stdcall MongateCsGetStatusReport(SOCKET sock, char strMsg[500][255])
先我要把它转化为C#的DLL,请问这个函数怎么转啊? --------------------编程问答-------------------- int MongateCsGetStatusReport(System.Net.Sockets.Socket sock,char[] strMsg)
如果char[] 不行你可以用string[]
--------------------编程问答-------------------- 参照如下格式:
[System.Runtime.InteropServices.DllImport("user32.dll")] //申明API函数        
            public static extern bool UnregisterHotKey(         
            IntPtr hWnd,
            int id
            ); --------------------编程问答-------------------- [DllImport("***.dll", EntryPoint = "MongateCsGetStatusReport")]
        private static extern int MongateCsGetStatusReport(SOCKET   sock,   char   strMsg[500][255]); --------------------编程问答-------------------- 你要搞明白SOCKET   是一种什么类型
如果知道的话,那么你调用就是这么用,先定义一个SOCKET   类型的变量 sock
int i;
char[,] a = new char[500][255];
然后给变量 sock和数组 a 赋值,就可以调用了。
i = dll.MongateCsGetStatusReport(sock,a); --------------------编程问答-------------------- mark
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,