VC ++ DLL creation and use

xiaoxiao2021-03-05  30

1 DLL Type: There are three Win32DLL: do not use the MFC library, can be used by any program. The MFC Regular DLL uses the MFC library to be static or dynamically connected to the MFC library, which can be used by any program. MFC Extension DLL, compiled with MFC dynamics, can only be used by the MFC program. Similarities and differences between three DLLs:

2 DLL Creation and Call 2.1 Win32DLL Create Two Methods: A Pass .H file Defining Resources B To output the resources to output through the .def file 2.h file defined for the resource to output: Win32DLL_H .h extern "C" __declspec (dllexport) int MaxNum (int a, int b); win32dll_h.cpp DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {switch (ul_reason_for_call) {case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: BREAK;} Return True;

INT MAXNUM (INT A, INT B) RETURN A; Else Return B;} 2.1.2 Use the .def file to define the resource W32DLL_DEF.DEF to output; is the notes Symbol in a Def File Library W32DLL_DEF

Description "W32DLL_DEF Windows Dynamic Link Library"

转载请注明原文地址:https://www.9cbs.com/read-33457.html

New Post(0)