64,646
社区成员
发帖
与我相关
我的任务
分享
#include "windows.h"
#include "stdio.h"
class test
{
public:
int ptest()
{
printf("test.ptest();\n");
return 0;
}
};
test *p;
BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
if(ul_reason_for_call==DLL_PROCESS_ATTACH)
{
p=new test();
return true;
}
if(ul_reason_for_call==DLL_PROCESS_DETACH)
{
delete p;
return true;
}
else
{
return true;
}
}
int __declspec(dllexport) test_ptest()
{
return p->ptest();
}