123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #pragma once
- #include "stdafx.h"
- #include "GlobalXJL.h"
- #include "..\\Global.h"
- HINSTANCE g_hXJLLibModule = NULL;
- AutoBIG5ToGB pAutoBIG5ToGB = NULL;
- AddList pAddList = NULL;
- ClearAlarm pClearAlarm = NULL;
- ClearList pClearList = NULL;
- CloseCommPort pCloseCommPort = NULL;
- DelList pDelList = NULL;
- DevReset pDevReset = NULL;
- OpenCommPort pOpenCommPort = NULL;
- OpenDoor pOpenDoor = NULL;
- ReadAllRecord pReadAllRecord = NULL;
- ReadCardSN pReadCardSN = NULL;
- ReadDevAbout pReadDevAbout = NULL;
- ReadDevSN pReadDevSN = NULL;
- ReadRecord pReadRecord = NULL;
- ReadSetting pReadSetting = NULL;
- ReadState pReadState = NULL;
- ReadTime pReadTime = NULL;
- SetAutoBIG5ToGB pSetAutoBIG5ToGB = NULL;
- SetDevNo pSetDevNo = NULL;
- SetShowTitle pSetShowTitle = NULL;
- SetShowMessage pSetShowMessage = NULL;
- SetNetPWD pSetNetPWD = NULL;
- StopOpCard pStopOpCard = NULL;
- WarrantSystem pWarrantSystem = NULL;
- WriteSetting pWriteSetting = NULL;
- int InitDll()
- {
- int nRet = 0;
- /////////////////
- g_hXJLLibModule = NULL;
- CHAR strDllFile[255 + 1] = "";
- wsprintf(strDllFile, "%s\\ĐĄžŤÁé\\168netcom.dll", g_strDirectory);
- g_hXJLLibModule = LoadLibrary(strDllFile);
- if (NULL != g_hXJLLibModule)
- {
- pAutoBIG5ToGB = (AutoBIG5ToGB)::GetProcAddress(g_hXJLLibModule, "AutoBIG5ToGB");
- pAddList = (AddList)::GetProcAddress(g_hXJLLibModule, "AddList");
- pClearAlarm = (ClearAlarm)::GetProcAddress(g_hXJLLibModule, "ClearAlarm");
- pClearList = (ClearList)::GetProcAddress(g_hXJLLibModule, "ClearList");
- pCloseCommPort = (CloseCommPort)::GetProcAddress(g_hXJLLibModule, "CloseCommPort");
- pDelList = (DelList)::GetProcAddress(g_hXJLLibModule, "DelList");
- pDevReset = (DevReset)::GetProcAddress(g_hXJLLibModule, "DevReset");
- pOpenCommPort = (OpenCommPort)::GetProcAddress(g_hXJLLibModule, "OpenCommPort");
- pOpenDoor = (OpenDoor)::GetProcAddress(g_hXJLLibModule, "OpenDoor");
- pReadAllRecord = (ReadAllRecord)::GetProcAddress(g_hXJLLibModule, "ReadAllRecord");
- pReadCardSN = (ReadCardSN)::GetProcAddress(g_hXJLLibModule, "ReadCardSN");
- pReadDevAbout = (ReadDevAbout)::GetProcAddress(g_hXJLLibModule, "ReadDevAbout");
- pReadDevSN = (ReadDevSN)::GetProcAddress(g_hXJLLibModule, "ReadDevSN");
- pReadRecord = (ReadRecord)::GetProcAddress(g_hXJLLibModule, "ReadRecord");
- pReadSetting = (ReadSetting)::GetProcAddress(g_hXJLLibModule, "ReadSetting");
- pReadState = (ReadState)::GetProcAddress(g_hXJLLibModule, "ReadState");
- pReadTime = (ReadTime)::GetProcAddress(g_hXJLLibModule, "ReadTime");
- pSetAutoBIG5ToGB = (SetAutoBIG5ToGB)::GetProcAddress(g_hXJLLibModule, "SetAutoBIG5ToGB");
- pSetDevNo = (SetDevNo)::GetProcAddress(g_hXJLLibModule, "SetDevNo");
- pSetShowTitle = (SetShowTitle)::GetProcAddress(g_hXJLLibModule, "SetShowTitle");
- pSetShowMessage = (SetShowMessage)::GetProcAddress(g_hXJLLibModule, "SetShowMessage");
- pSetNetPWD = (SetNetPWD)::GetProcAddress(g_hXJLLibModule, "SetNetPWD");
- pStopOpCard = (StopOpCard)::GetProcAddress(g_hXJLLibModule, "StopOpCard");
- pWarrantSystem = (WarrantSystem)::GetProcAddress(g_hXJLLibModule, "WarrantSystem");
- pWriteSetting = (WriteSetting)::GetProcAddress(g_hXJLLibModule, "WriteSetting");
- }
- if( ( NULL != g_hXJLLibModule ) )//&& ( NULL != pRegdllInit ) )
- {
- //nRet = pRegdllInit( g_strDirectory );
- //if( nRet == -1 )
- //{
- // FreeLibrary( g_hXJLLibModule );
- // g_hXJLLibModule = NULL;
- // return -1;
- //}
- }
- else
- {
- FreeLibrary( g_hXJLLibModule );
- g_hXJLLibModule = NULL;
- return 1;
- }
- return nRet;
- }
- void UnInitDll()
- {
- if( NULL != g_hXJLLibModule )
- {
- FreeLibrary( g_hXJLLibModule );
- g_hXJLLibModule = NULL;
- }
- }
|