1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include "stdafx.h"
typedef OLECHAR FAR* BSTR;
typedef bool (WINAPI* DLL_Function_Connect_Net) (BSTR, long);
///typedef bool (WINAPI* DLL_Function_GetUserInfo) (int, int, string*, string*, int, bool);
DLL_Function_Connect_Net Connect_Net;
//DLL_Function_GetUserInfo GetUserInfo;
int _tmain(int argc, _TCHAR* argv[])
{
HINSTANCE HStpDll = LoadLibrary(_T("zkemsdk.dll"));
Connect_Net = (DLL_Function_Connect_Net)GetProcAddress( HStpDll, "Z_Connect_NET");
//GetUserInfo = (DLL_Function_GetUserInfo)GetProcAddress( HStpDll, "Z_GetUserInfo");
bool result = false;
cout << "Result [ " << result << " ]\n";
BSTR IP_adresse = SysAllocString(L"192.168.1.201");
char* IP_adresse_char = "192.168.1.201";
result = Connect_Net(IP_adresse, 4370);
cout << "Result [ " << result << " ]\n";
return 0;
} |