15,978
社区成员
发帖
与我相关
我的任务
分享class CMyDlg : public CDialog
{
DECLARE_DYNAMIC(CMyDlg)
public:
CMyDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CMyDlg();
// Dialog Data
enum { IDD = IDD_DLG_DISCARD };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
CString m_strImage;
public:
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
void SetImage(CString strName);
}; CMyDlg *dlg;
switch(model) // model是int型
{
case 0:
dlg.SetImage(1.jpg);
break;
case 1:
dlg.SetImage(1.jpg);
break;
case 2:
dlg.SetImage(1.jpg);
break;
case 3:
dlg.SetImage(1.jpg);
break;
}
dlg->DoModal();