3、lace "dll.h" with the name of your header */#include "dll.h"#include #include #include DLLIMPORT void HelloWorld (){ MessageBox (0, "Hello World from DLL!", "Hi", MB_ICONINFORMATION);}近来又有人在群里问如何用c语言编制dll文件(动态链接库)。原来没有对这个问题太
5、NG_DLL# define DLLIMPORT __declspec (dllexport)#else /* Not BUILDING_DLL */# define DLLIMPORT __declspec (dllimport)#endif /* Not BUILDING_DLL */DLLIMPORT void HelloWorld (void);#endif /* _DLL_H_ *//*dllmain.c文件*//* Replace "dll.h" with the name of your heade
7、 DWORD reason /* Reason this function is being called. */ , LPVOID reserved /* Not used. */ ){ switch (reason) { case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break;
8、 case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } /* Returns TRUE on success, FALSE on failure */ return TRUE;}关于以上代码的几点解释:一、__declspec (dllex