Using dynamic link MFC, MFC controls such as CButton whether in mfc100u. DLL DLL, mfc100u. The DLL is to export CButton, otherwise, how can the outside, but didn't see mfc100u. DLL export CButton ah,
CodePudding user response:
CButton these should be the source code to compile, you can find in the installation directory for the VC
CodePudding user response:
CButton not control, is a source code, CButton at controls reader, an east east CButton, would bind to a resource ID, this resource ID is, when he started to Load a dialog resource files (a text file, suffix. Rc, have seen), and then generate a dialog box, he will according to the resource file create control entities, each control corresponding to an ID, then CButton binding real control by the control ID, so even if no CButton, can have a button control dialog, CButton not must exist, nor is he controls,,,
CodePudding user response:
# include & lt; Commctrl. H>
Commctrl. DLL
CodePudding user response:
Common control comctl32. DLL COMDLG32. DLL's own system, and therefore under Win32 can also use the
CodePudding user response:
reference schlafenhamster reply: 3/f # include & lt; Commctrl. H> Commctrl. DLL CButton class - this class is in mfc100u. The inside of the DLL, how I want to know mfc100u. DLL export CButton CodePudding user response:
Common control comctl32. DLL has nothing to do with MFC, static connection does not need MFCxx. DLL CodePudding user response:
CButton only MFC package the "Button" controls CodePudding user response:
DLL export function name the things Key words: vc + + DLL export functions Often use VC6 Dependency check the name of the DLL export functions, can find the name of the DLL export functions are sometimes very different, the cause of different mostly and compile DLL when specified by the qualifier with the DLL export functions, Vc + + to support two languages: C/C + +, this also is the root cause of the differences in the DLL export functions We use VS2008 new DLL project, a project called "TestDLL" The default source file suffix. CPP instead. C (C) Enter the test code is as follows: 01 int _stdcall MyFunction (int iVariant) 02 { 03 return 0; 04} In order to export the function above, we have the following several methods: 1. Using the traditional (. The module definition file (def) A new suffix for. Def text file (here to build a TestDll. Def), the file content is: The LIBRARY TestDll EXPORTS MyFunction When the Link specified depends on input file:/DEF: "TestDll. DEF "2. Visual c + + provides convenient way Join before 01 done int __declspec (dllexport) keyword Through the above two methods, we can export MyFunction function, We use the Dependency check the exported functions: The first method the exported functions as follows: MyFunction The second method the exported functions as follows: _MyFunction @ 4 __stdcall can make the export function to add an underscore the names, followed a @ plus the number of bytes parameters, such as _MyFunction @ 4 parameters (int iVariant) is 4 bytes __fastcall as __stdcall similar, but not in front of the underline, but a @, such as @ MyFunction @ 4 __cdecl is beginning the function name, Summary: if you want to export the function in the C file, and don't let the compiler function name, def file is used to derive the function, Let's take a look at c + + files We use VS2008 new DLL project, a project called "TestDLL" The default source file suffix for the CPP (namely c + + files), Enter the test code is as follows: 01 int _stdcall MyFunction (int iVariant) 02 { 03 return 0; 04} In order to export the function above, we have the following several methods: 3. Use the traditional (. The module definition file (def) A new suffix for. Def text file (here to build a TestDll. Def), the file content is: The LIBRARY TestDll EXPORTS MyFunction When the Link specified depends on input file:/DEF: "TestDll. DEF "4. Visual c + + provides convenient way Join before 01 done int __declspec (dllexport) keyword Through the above two methods, we can export MyFunction function, We use the Dependency check the exported functions: The first method the exported functions as follows: MyFunction The second method the exported functions as follows: ? MyFunction @ @ YGHH @ Z Can see the second method to get the export function name is not what we want, and if used display method in exe MyFunction (LoadLibrary and GetProcAddress call) call will fail, But with the import library (*. LIB) calls, the compiler automatically convert the function name, so there is no problem, always Solve the problem of method is: Using VC preprocessor directive to "# pragma" option to specify links, As follows: # pragma comment (would, "/EXPORT: MyFunction=? MyFunction @ @ YGHH @ Z ") At this moment, you will find the exported function name in the table have we want MyFunction, but we found the original? MyFunction @ @ YGHH @ Z function is still there, then you can put the __declspec () modified to remove, you just need to pragma directive, But also can make the following format: # pragma comment (would/EXPORT: MyFunction=_MyFunction @ 4, "PRIVATE") The role of PRIVATE and its role in the def file, more # pragram please see MSDN, Summary: if you want to export functions in c + + files, and don't let the compiler function name, def file is used to derive the function, At the same time can use the # pragma instruction can also be used in (C), Conclusion: In c + + compiler to generate DLL, adaptation, the name of the exported functions and different compiler USES adaptation rules are different, so the adaptation after name are different (typically involves the overloading in c + +, etc.), If using different compiler generated DLL and visit DLL exe program respectively, the latter in to access the DLL's exported functions can be a problem, as above case MyFunction () function in c + + compiler adapted after's name is? MyFunction @ @ YGHH @ Z, we hope that the name of the compiled no change, there are several methods, The first method is through a called DEF module definition files to resolve, The LIBRARY TestDll EXPORTS MyFunction LIBRARY is used to specify dynamic link LIBRARY internal name, the name and generate dynamic link LIBRARY name must match, this code is not necessary, EXPORTS illustrates the DLL will export function, as well as for the export function specified symbol name, The second is to define the exported functions plus qualifiers: extern "C" Such as: # define DLLEXPORT_API extern "C" _declspec (dllexport) But extern "C" only solved the call between C and C + + language problems (extern "C" is tells the compiler, and make it the way the C compiler), it can only be used for export global function this kind of situation and cannot export a class member function, If the export function calling conventions change at the same time, even using extern "C", the compiled function name will change, for example above we join _stdcall keyword description calling conventions (standard calling conventions, namely WINAPI calling convention), # define DLLEXPORT_API extern "C" _declspec (dllexport) 01 DLLEXPORT_API int _stdcall MyFunction (int iVariant) 02 { 03 return 0; 04} The compiled function MyFunction adapted _MyFunction @ 4 By the first method is the module definition file compiled DLL export function name won't change, DLL (dynamic library) export function name garbled meaning C + + compiler function name modified agreed rules: __stdcall calling convention: 1, in order to "?" Identify the start of the function name, followed by the function name; 2, behind the function name, with the beginning of the "@ @ YG" table that identifies a parameter, followed by the parameter list; 3, the parameter list to code said: X - void D - char E - unsigned char F - short H - int I, unsigned int J - long K - unsigned long M - float N - double _N - bool . PA - said a pointer, the back of the code that pointer type, if the same type of pointer appears in a row, to "0" instead of a "0" is for a repeat; Table 4, the parameters of the first item for the function return value type, followed by subsequent parameter data types, pointer id before referred to in the data type; 5, parameter table to identify the name "@ Z" after the end of this function has no parameters, ends with a "Z" logo, The format for? "" Functionname @ @ YG "or" * * * * * @ Z? Functionname @ @ YG * XZ ", for example, nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull