我用MFC向导建立一对话框类,在另一类中调用,可该对话框显示不出来,WHY???

superdreamer 2002-05-09 11:48:27
我以前都是这样用的,可这次就不行,WHY?我在该对话框中用了ACTIVE 控件
...全文
114 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
superdreamer 2002-05-09
  • 打赏
  • 举报
回复
#if !defined(AFX_SETRTDLG_H__EF60B380_0057_4594_B243_5E43E7841423__INCLUDED_)
#define AFX_SETRTDLG_H__EF60B380_0057_4594_B243_5E43E7841423__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SetRtDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CSetRtDlg dialog

class CSetRtDlg : public CDialog
{
// Construction
public:
CSetRtDlg(CWnd* pParent = NULL); // standard constructor

// Dialog Data
//{{AFX_DATA(CSetRtDlg)
enum { IDD = IDD_MAKE_REALRT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA


// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSetRtDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:

// Generated message map functions
//{{AFX_MSG(CSetRtDlg)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SETRTDLG_H__EF60B380_0057_4594_B243_5E43E7841423__INCLUDED_)

////////////////////////////
// SetRtDlg.cpp : implementation file
//

#include "stdafx.h"
#include "smilgen.h"
#include "SetRtDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSetRtDlg dialog


CSetRtDlg::CSetRtDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetRtDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetRtDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}


void CSetRtDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetRtDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSetRtDlg, CDialog)
//{{AFX_MSG_MAP(CSetRtDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSetRtDlg message handlers







///////////////////////
void CSMILGenDoc::OnEditMakeRt()
{
// TODO: Add your command handler code here
CSetRtDlg dlg;
dlg.DoModal ();
}





Kevin 2002-05-09
  • 打赏
  • 举报
回复
给代码看看。
tengfei2002 2002-05-09
  • 打赏
  • 举报
回复
用CDialog::DoModal()了吗
AttaBoy 2002-05-09
  • 打赏
  • 举报
回复
CRichEdit控件需要进行Com初始化
在你的应用程序初始化中加入
AfxInitRichEdit()就行了
superdreamer 2002-05-09
  • 打赏
  • 举报
回复
谢谢各位的回答,问题上找出来了,可我现在都没高明白!我在该对话框中有一CRichEdit控件,我把他删掉就可以,不知是不是我的属性设置有问题,
garry_agh 2002-05-09
  • 打赏
  • 举报
回复
改用堆对象 CSetRtDlg *dlg = new CSetRtDlg() ;
dlg->DoModal ();
lshadow 2002-05-09
  • 打赏
  • 举报
回复
你的调用该对话框类的基类是CWnd 吗?如果不是就不行!
你可以这样
CSetRtDlg dlg(this);
看编译能否通过
doublesword 2002-05-09
  • 打赏
  • 举报
回复
SMILGenDoc.cpp里面包括了头文件了吗?
应该包括了,不然会出错的!
OnEditMakeRt() 这个函数干什么用的?
fhbkyo 2002-05-09
  • 打赏
  • 举报
回复
用了什么应该与对话框本身无关的
如果不是对话框是不能用DoModal()函数的
你的程序好象在一个对话框中又要打开这个对话框

16,470

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧