test.cpp

来自「门禁接口DLL」· C++ 代码 · 共 42 行

CPP
42
字号
// TEST.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "mj800dll.h"

#pragma comment(lib, "MJ800DLL.lib")

HANDLE hStopEvent;

int main(int argc, char* argv[])
{
	hStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
	if (hStopEvent == NULL)
	{
		printf("CreateEvent failed with %u.\n",
			GetLastError());
		return 1;
	}

	if (!htsInitalise())
	{
		printf("Initialize failed with %u.\n",
			GetLastError());
		return 1;
	}

	LPSTR card = "00000000";
	LPSTR time = "0000000000000000000";

	while (WaitForSingleObject(hStopEvent, 10) != WAIT_OBJECT_0)
	{
		if (htsReadCard(card, time))
		{
			printf("card number : %s\ntime is : %s\n",
				card, time);
		}
	}

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?