Home > Software engineering >  MFC application (based on the dialog box) how to use it yourself win32 static library (MFC)
MFC application (based on the dialog box) how to use it yourself win32 static library (MFC)

Time:09-26

I use the win32 project, select the static library, select MFC support, oneself do a static library, there is a dialog box, the class name is CStaticLib, I then create an MFC application (based on the dialog box), want to use my class, contains the header files and libraries, but I do not pop up dialog box, what should I do? Can't MFC applications use made of the WIN32 static library?

CodePudding user response:

Void CTestStaticLibDlg: : OnBnClickedButton1 ()
{
CStaticLib DLG.
DLG. DoModal ();
}
I call so in MFC application, it is not the pop-up dialog box I do! O great god solve!!!!!!!!!!

CodePudding user response:

Internal packaging dynamic library is written so, should be your internal implementation problems
 AFX_MANAGE_STATE (: : AfxGetStaticModuleState ()); 
CXXXXDlg _dlg (CWnd: : FromHandle (AfxGetMainWnd () - & gt; GetSafeHwnd ()));
_dlg. DoModal ();
return TRUE;

CodePudding user response:

In the call DoModal () before calling AFX_MANAGE_STATE (AfxGetStaticModuleState ());
  • Related