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/332277CodePudding user response:
Have you seen DLG header file is a resource idCodePudding 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/8502106CodePudding user response: