求助:可以使 dll 里面的某个函数,自动运行不?
#include "stdafx.h"
#include <iostream>
using namespace std;
#ifdef DLLTEST_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
int i = 0;
extern "C" DLL_API int readNumber()
{
i = 0; //清0
}
void loop()
{
i ++;
if (i >= 100000)
{
while(true)
{
}
}
}
如果吧 这段断码 封装为 DLL
怎么使 loop 不停的自动运行
是不是 dll 不能实现这样的 功能啊
是这样的,我是 C# 调用这个 dll
这个 dll 里封装了 读取加密狗的 信息
如果多久不调用 这个 dll 的 readNumber()
则程序进入死循环
希望不是外面的 C# 来循环调用 loop(),
而是 dll 自己 循环调用 loop()
谢谢!