Home > Software engineering >  Call dynamic repository dialog
Call dynamic repository dialog

Time:12-24

 

Extern "C" __declspec (dllexport) void show ()//this paragraph can call DLL, but I want to try this method
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());

CDlgioCheck dlg1;
Dlg1. DoModal ();
}


//I directly add a dialog box class header file, and then

CDlgioCheck dlg1;//compiled, but interrupt happens, as the chart
Dlg1. DoModal ();




Excuse me everybody, because can not be called directly dialog like this?
Or you don't what I do is I overlooked?

CodePudding user response:

The DLL has added the corresponding dialog resource IDD_XXXXX?
Click retry to debug to see

CodePudding user response:

DLL switch resource problem, you can refer to this: https://blog.csdn.net/optman/article/details/332277

CodePudding user response:

Have you seen DLG header file is a resource id

CodePudding user response:

Dialog box is no problem,
 extern "C" __declspec (dllexport) void show ()//this paragraph can call DLL, but I want to try this method 
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());

CDlgioCheck dlg1;
Dlg1. DoModal ();
}


Such written can display normally, but I want to try another way

CodePudding user response:

 # pragma once 
# include "staticcolor. H"


//CDlgpwd dialog
# define IDD_DIALOG_PWD 136
The class __declspec (dllexport) CDlgpwd;
The class CDlgpwd: public CDialog
{
DECLARE_DYNAMIC (CDlgpwd)

Public:
PParent CDlgpwd (CWnd *=NULL);//standard constructor
Virtual ~ CDlgpwd ();

//data dialog
Enum {IDD=IDD_DIALOG_PWD};

Protected:
Virtual void DoDataExchange (CDataExchange * symbol;//support DDX/DDV

DECLARE_MESSAGE_MAP ()
Public:
Cstrings m_password;
Afx_msg void OnPaint ();
CStaticColor m_stcColorPwd;
Virtual BOOL OnInitDialog ();
CButtonColor m_btnok;
CButtonColor m_btncancel;
};


What ID I think no problem

CodePudding user response:

https://blog.csdn.net/wlsgzl/article/details/8502106

CodePudding user response:

refer to the second floor qinqin73 response:
DLL switch resource problem, you can refer to this: https://blog.csdn.net/optman/article/details/332277

Like this not line, this method is not well said
 extern "C" __declspec (dllexport) void show ()//this paragraph can call DLL, but I want to try this method 
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());

CDlgioCheck dlg1;
Dlg1. DoModal ();
}


I want to achieve is
 
# include "CDlgioCheck
"CDlgioCheck dlg1;//I want to achieve such calls dynamic library
Dlg1. DoModal ();
  • Related