Unitech PA500 Manuel d'utilisateur Page 28

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 30
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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);
//////////////////////////////////////////////////////////////////////////////////////////
Vue de la page 27
1 2 ... 23 24 25 26 27 28 29 30

Commentaires sur ces manuels

Pas de commentaire