//啟動com庫
WSADATA Data_WSA;
int nWSAStartup = WSAStartup(MAKEWORD(1, 1), &Data_WSA);
if( nWSAStartup != 0 )
{
return;
}
//加載動態鏈接庫
AnsiString str= strPath + (AnsiString)"\\Net.dll";
HINSTANCE handle = LoadLibrary(str.c_str());
if (handle == NULL)
{
return;
}
//打開網口
FARPROC lpFarProc;
lpFarProc = GetProcAddress(handle,"OpenNet");
long (*OpenNet)(char*,long);
OpenNet = (long (__cdecl*)(char*,long))lpFarProc;
long lSuccess = OpenNet("192.168.0.1", 8080);
if (lSuccess != 0)
{
FreeLibrary(handle);
return;
}
//釋放動態鏈接庫
FreeLibrary(handle);