下面是C++中的函数原型和调用方法
CMPP_API dpl_status_t cmpp_connect_to_ismg(char *host,dpl_port_t port,conn_desc *conn);
stat = cmpp_connect_to_ismg("211.130.24.51",7800,&conn);//建立与ISMG服务器的连接
用C#怎么调用呢?
示例:
[ DllImport( "api.dll", CharSet=CharSet.Ansi)] // EntryPoint="cmpp_connect_to_ismg",
public static extern int cmpp_connect_to_ismg( ref string host,short port,[MarshalAs(UnmanagedType.LPStruct)] ref conn_desc conn);
//@@无符号short//
调用
string ipstr="211.138.24.51";
stat = esp.cmpp_connect_to_ismg(ipstr,7890,ref conn);//建立与ISMG服务器的连接
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-442047/
,如需转载,请注明出处,否则将追究法律责任。