Creating the modal dialog box in the MFC Regular DLLCreating a modal dialog box in an MFC Regular DLL is very simple, CDialog the base class provides a method DoModal () that can create a modal dialog box, so you create a Regular dialog box in the MFC modal DLL, Just need to inherit the dialog base class yourself, call DoModal in the export function.Create the modeless dialog box in the MFC Regular Dll.Because the MFC application framework is just encapsulation of the WIN32 function, creating a modeless dialog box in an MFC Regular DLL actuallymethod One (Win32 DLL) that generates a dialog box in a DLLThe internal principle of the generated modeless dialog is consistent, and the difference is that only a little bit of skill is needed in the MFC framework. We know that in Win32 SDK programming, there is a main window handle HWND, also in MFC, there is a variable, but it is now encapsulated in the Cwindthread, we can see in the AFXWIN.H that the definition: ... cwnd* m_pMainWnd; main window (usually same afxgetapp ()->m_pmainwnd) ... And we know that CWinApp is inherited from CWinThread. Let's look at the encapsulation of the window process, in MFC, the CFrameWnd category can be used to create Windows, and internally define window procedures, specifically, that is, the CREATEWINDOW,MESSAGELOOP mechanism is implemented in that category. With the ground above, we'll see.method One (Win32 DLL) that generates a dialog box in a DLLThe steps in this article to generate the modeless dialog: 1: We first set up a main window, but do not display the window, what we really need is the Windows handle HWND. 2: Creates a dialog box that sets the owner handle of the dialog box to HWND. 3: The message is diverted. behind the steps above actually hides a trick inside: we can discard the hwnd, that is, we can set the dialog handle to the HWND, so we can omit the third step, do not have to do in the message loop where the message shunt, So our code looks like this ... hwnd = CreateWindow (Szappname, TEXT ("Modeless_dialog"), Ws_overlappedwindow | Ws_clipchildren, cw_usedefault, Cw_usedefault, Cw_usedefault, Cw_usedefault, null, NULL, HINSTANCE, NULL); //ShowWindow (hwnd, Icmdshow); // The main window is not shown here //UpdateWindow (HWND); hwnd = Createdialog (HINSTANCE, Makeintresource (IDD_DIALOG1), NULL, Dlgproc); while (GetMessage (&msg, NULL, 0, 0)) {& nbsp; TranslateMessage (&msg); DispatchMessage (&msg); }... Ok here we can follow the above steps to generate a dialog box in the MFC Regular DLL 1: Build an MFC Regular DLL with AppWizard. 2: Derive a new class Cmyframewnd class from CFrameWnd, because we just need to produce a window that does not display, so all actions take the default action. Class Cmyframe:public CFrameWnd {Public:cmyframe (); Declare_message_map ()}; 3: Derive a new CMyDialog class from CDialog. 4: Because CWinApp's InitInstance () is used to initialize the application. So we add the following code to the CMyWinApp InitInstance method: m_pMainWnd = new Cmyframe (); m_pMainWnd = Pdlg; Pdlg is a pointer to a Cmydialg object. 5: Write export function: extern "C" void __declspec (dllexport) show () {pdlg->domodal ();//Display Dialog} from the above steps we can see that in MFC Regular D The way to show the modeless dialog box in ll is to follow the methods in the Win32 DLL, of course, because MFC's object-oriented features, as long as we follow this approach, we can have more ways to achieve, but the introduction here should be the simplest and most direct way.