Unitech PA500 manual Dynamic Load DLL

Page 28

7. Dynamic Load DLL

Compiler would not load the DLL while use dynamic load DLL, it help user to load the DLL if it exists while the application executed. The follow is the example.

Note: Even user does not need include the header and lib file but need to know the function definition.

//////////////////////////////////////////////////////////////////////////////////////////

HINSTANCE g_hUSIDLL;

typedef BOOL (*lpfnUSI_GetScannerVersion)(LPTSTR model, LPTSTR firmware, LPTSTR sdk, int blen); lpfnUSI_GetScannerVersion USI_GetScannerVersion;

g_hUSIDLL = LoadLibrary(L"\\Windows\\USI.dll");

if (g_hUSIDLL != NULL)

{

USI_GetScannerVersion = (lpfnUSI_GetScannerVersion)GetProcAddress(g_hUSIDLL,

TEXT("USI_GetScannerVersion"));

}

else

{

MessageBox(_T("Load library USI.dll fail"), NULL, MB_OK); return;

}

TCHAR lstrmodel[50], lstrfirmware[50], lstrsdk[50];

if (USI_GetScannerVersion != NULL)

rc = USI_GetScannerVersion(lstrmodel, lstrfirmware, lstrsdk, sizeof(lstrmodel) + sizeof(lstrfirmware) + sizeof(lstrsdk));

else

MessageBox(_T("USI_GetScanerVersion does not find"), NULL, MB_OK);

if (g_hUSIDLL != NULL) FreeLibrary(g_hUSIDLL);

//////////////////////////////////////////////////////////////////////////////////////////

-

Image 28
Contents PA500 Programming Manual Automatically enable scanner beam with pressing trigger key USI.DLL Unitech Scanner Interface DLLSCANKEY3.DLL Backward Compatible API for PT930/PT930S’S GET Device ID Update Notes Introduction How to download data from scanner COM definition for PA500 Function call Parameter inputEnable / Disable Scanner Reset ScannerGet error code Returns the system error codeFunction Description Get scan dataParameter output Get Symbology name Get length of scanned dataGood read indicator Wait for acknowledgement of the last sent commandSave setting to profiles Clear scan data system bufferSave scanner setting into specified file Change scanner setting from specified setting profileAutomatically enable scanner beam with pressing trigger key Parameter output ReturnCheck if auto scanning is enable Test if Scan2Key is enabledStop auto scanning function Check if Scan2Key.exe program is running or notEnable/Disable Scan2Key Send scanner command to decoding chipOnly send single command decoding chip Esc, 0x80+cmd Function callSend command to decoding chip Esc, parameter1, parameter2, …, BCCSpecial Command for control Control command for decoder chipEnable in Communication TRACK1,5 TRACK2,6 TRACK3 Code32setCodabarset LabelcodeUpcaset UpcesetUPC a Disable Decoder PTEnableBarcode Function callCheck barcode input Return codeRead barcode data Reset all symbologies to defaultGet DLL version no Disable laser trigger key Enable laser trigger keyPTEnableBarToKey Function call for VC INT PTVersionvoid Return IntegerSysIOAPI.DLL Keypad Related FunctionsReturn code Bool True Caps lock False Caps unlock Return code True Shift lock False Shift unlock Scanner Related Functions ParameterInputLED related function ExampleLCD/Backlight related function ParametersInputDynamic Load DLL Get Device ID Update notes
Related manuals
Manual 84 pages 14.34 Kb