Unitech PA500 Manuale Utente Pagina 28

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 30
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 27
-
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);
//////////////////////////////////////////////////////////////////////////////////////////
Vedere la pagina 27
1 2 ... 23 24 25 26 27 28 29 30

Commenti su questo manuale

Nessun commento