#ifdef _WIN32
typedef SOCKET dpl_socket_t;
#else
typedef int dpl_socket_t;
#endiftypedef struct conn_desc conn_desc;
struct conn_desc{
dpl_socket_t sock;
unsigned long seq;
int status;
char act_flag;
};
CMPP_API dpl_status_t cmpp_connect_to_ismg(char *host,dpl_port_t port,conn_desc *conn);本人在vb中定义:
Type CONN_DESC
    sock As Long
    seq As Long
    status As Long
    act_flag As Byte
End TypePublic Declare Function cmpp_connect_to_ismg Lib "api.dll" (ByVal host As String, ByVal port As Long, conn As CONN_DESC) As Long调用:    Dim intState As Long    intState = cmpp_connect_to_ismg("134.130.51.68", 7890, ConnDesc)

解决方案 »

  1.   

    VB只能调用__stdcall调用约定的函数,而C语言默认调用约定是__cdecl,
    故要在DLL导出函数前添加__stdcall或者WINAPI
      

  2.   

    实用代码:VBAnyCall类——任意调用函数代码(包括__cdecl调用约定的函数及汇编代码) :http://community.csdn.net/Expert/topic/2952/2952906.xml?temp=.9332849
      

  3.   

    应该就是 Bosee(電腦頑童 所提到的问题。另外 实用代码:VBAnyCall类——任意调用函数代码(包括__cdecl调用约定的函数及汇编代码)中:
    要添加防崩溃模块代码请看 http://expert.csdn.net/Expert/TopicView1.asp?id=2859424
    添加了防崩溃模块代码后就可以把 Call InitExceptionHandler前的注释号去掉但是这个地址不能访问,提示:缺少 ID 参数,请输入!!