静态调用DLL
有一MwNetGate.dll,里面有一函数:function ConnectOpen(const Uid: WideString; const Password: WideString;const ServerIP: WideString; ServerPort: Integer):Integer;
我把MwNetGate.dll转换成MwNetGate.lib,并Project->Add to Project把此文件加载到工程中后,
在.h中声明如下:int ConnectOpen(const WideString Uid,const WideString Password,const WideString ServerIP,int ServerPort);
然后调用:
void __fastcall TForm1::Button3Click(TObject *Sender)
{
if(ConnectOpen("13178930258","123456","61.242.89.115",8018)==0);
{
Application->MessageBox("成功!","成功",MB_OK);
}
else
{
Application->MessageBox("失败!","失败",MB_OK);
}
}
总是提示出错:[C++ Error] User_sendmsg.cpp(112): E2054 Misplaced else
请各位大侠指点!小弟感激不尽!