【发布时间】:2009-11-20 01:01:48
【问题描述】:
我有一个 .dll 文件和它的 .lib 文件。
DLL 与电子钥匙阅读器对话,并允许您读取/写入钥匙 ID。
这是随附的唯一文档:
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)
我以前从未使用过 DLL,我真的不知道我应该如何在 C 程序中使用它。我真的不知道过去会做什么:
#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;
}
如果有人可以向我展示如何获取 DevicePresent 以及如何使用 WriteKeyId 的示例,我将非常感激!
【问题讨论】:
-
你使用的是什么框架/IDE/编译器?