J'ai un fichier .dll et le fichier .lib pour cela. La DLL communique avec un lecteur de clé électronique et vous permet de lire/écrire l'ID de clé.Comment utiliser un DLL?
Ceci est la seule documentation fournie avec:
DLL Usage:
boolean = object.DevicePresent (PROPERTY: true if the device is present)
boolean = object.KeyPresent (PROPERTY: true if a key is in the device)
long = object.KeyId (PROPERTY: gets the keys id)
object.WriteKeyId KeyId (METHOD: Writes new id to the key)
Private Sub object_KeyRemoved (EVENT: Key removed)
Je ne l'ai jamais utilisé DLL avant et ne sais vraiment pas comment je suis censé l'utiliser dans un programme C. Je ne sais vraiment pas quoi faire ce passé:
#include <stdlib.h>
#include <windows.h>
typedef int (__cdecl *MYPROC)(LPWSTR);
int main(int argc, char *argv[])
{
HINSTANCE hinstLib;
hinstLib = LoadLibrary(TEXT("ekey.dll"));
if (hinstLib != NULL)
{
//now what? how do i get the properties or call a method?
}
return 0;
}
Si quelqu'un pouvait me montrer un exemple comment comment obtenir DevicePresent et comment utiliser WriteKeyId je serais très reconnaissant!
Quel framework/IDE/compilateur utilisez-vous? – Pretzel