函数类型
/* Replace "dll.h" with the name of your header */#include "dll.h"
#include <windows.h>
#include<stdio.h>
DllClass::DllClass()
{
}
DllClass::~DllClass ()
{
}
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH: printf("DLL_PROCESS_ATTACH\n");
break;
case DLL_PROCESS_DETACH:printf("DLL_PROCESS_DETACH\n");
break;
case DLL_THREAD_ATTACH:printf("DLL_THREAD_ATTACH\n");
break;
case DLL_THREAD_DETACH:printf("DLL_THREAD_DETACH\n");
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
书本上一个参考程序如上,这个函数的函数类型是BOOL APIENTRY,函数名DllMain还是
函数类型是BOOL ,函数名APIENTRY DllMain?