返回信息流实在不好意思麻烦各位,问个挺小白的问题,我想在打开新对话框的同时立即处理消息,使一些数据库里的数据显示在新对话框的列表控件里,但是我不知道怎样把这个消息处理函数的优先度设为最优先(就像C里面的void main()函数,MFC的不知道。。)
不知道哪个才是新对话框(或者说叫子对话框?)的主函数,这应该怎么办啊?
这是一条镜像帖。来源:北邮人论坛 / cpp / #27855同步于 2009/8/31
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
[求助]怎样在打开新对话框的同时立即进行消息处理啊?
ad1075
2009/8/31镜像同步5 回复
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
【 在 zwp 的大作中提到: 】
: 在OnInitDialog()添加相应的函数,不要进行消息处理了。
对话框对应的cpp文件里没有OnInitDialog这个函数啊,要手动添加吗
// ShowAllDialog.cpp : implementation file
//
#include "stdafx.h"
#include "CreditManagement.h"
#include "ShowAllDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ShowAllDialog dialog
ShowAllDialog::ShowAllDialog(CWnd* pParent /*=NULL*/)
: CDialog(ShowAllDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(ShowAllDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void ShowAllDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ShowAllDialog)
DDX_Control(pDX, IDC_LIST1, m_List_ShowAll);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ShowAllDialog, CDialog)
//{{AFX_MSG_MAP(ShowAllDialog)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ShowAllDialog message handlers
就像这样的
【 在 ad1075 的大作中提到: 】
: 对话框对应的cpp文件里没有OnInitDialog这个函数啊,要手动添加吗
重写虚函数。需要手动添加,但是可以用VC自带的向导添加。
没有?
既然MFC,那就多使用向导添加东西...
【 在 ad1075 (assassin) 的大作中提到: 】
: 对话框对应的cpp文件里没有OnInitDialog这个函数啊,要手动添加吗