Home > Software engineering >  How to MFC dialog box packaging into static library lib, header files, and how to call?
How to MFC dialog box packaging into static library lib, header files, and how to call?

Time:09-19

I'd like to make a dialog box packaging into static LIB, not all dynamic DLL project!!!!! Dynamic library is static library project, I have achieved, but not too corresponds with my needs, I don't think all compiled into EXE with DLL, static lib project I also make a success, but don't know how to go to the header file to write, what's the extern "c", and the insides of the so called the lib

CodePudding user response:

Static library just like own code, header files can use the include came in

CodePudding user response:

Static library is put you in the library header files and lib together in another project, and other places include the header file can call a function, etc

CodePudding user response:

Put in a header file function declarations, do you want to add extern "C" is the function that you generate lib have add,
If the lib is C code generated, h plus EXTERN_C best this is the macro Windows header files, is equal to blank in C, C + + is equal to the extern "C", or your own written like this:
# ifdef __cplusplus
Extern "C"
# endif
If the lib is the C + + code generation, function of h is generally do not need to add extern "C", consistent with the implementation of CPP files can,
Then contains the h file, add contains the project Settings (header) and libraries directory can be used,

CodePudding user response:

Static library is essentially a piece of code

CodePudding user response:

# pragma comment (lib, "XXX. Lib")

CodePudding user response:

Upstairs said a lot of, pass by pass by!

CodePudding user response:

Why are in response to "how to use static library", the problem was "how to create a static library (interface)"

CodePudding user response:

refer to 7th floor TouchQN response:
why are in response to "how to use static library", the problem was "how to create a static library (interface)" oh
you don't understand your question the somebody else all realized just don't know how to call others

CodePudding user response:

The building Lord, to say the static library how to encapsulate the dialog box, under my encapsulation static library, test using static libraries dialog domodel (), dialog box does not show,,,

//interface in the static library:
Int setAuthentication ()
{
AuthenticaDlg DLG.
DLG. DoModal ();
return 0;
}

//the test program calls a static library interface:
Void CLibTestDlg: : OnBnClickedOk ()
{
//TODO: Add your the control notification handler code here
Int nRet=1;
NRet=setAuthentication ();
OnOK ();
}

CodePudding user response:

https://docs.microsoft.com/en-us/previous-versions/ms235627 (140) v=vs.

CodePudding user response:

https://blog.csdn.net/liunan199481/article/details/81513049

CodePudding user response:

Have you achieved? I also compile the MFC became lib, but in the main project call, always can't create a window, and then I found the lib file will contain the rc resources, now I put the resource file contains additional qualifications purpose in the resource file, but still create failure
  • Related