问题描述
大家好,
我的Appliation我有2个对话框:DialA和DialB
In DialB :: OnInitDialog()我有一些参数初始化,比如SetLimitText等...
当我通过DialA拨打DialB时(通过按下按钮),预设参数设置为DialB :: OninitDialog()确实有效。但是当我从菜单中拨打DialB时一切正常。
i甚至可以通过调试模式一步一步地走,但是当我进入时,前卫不会去断点通过DialA呼叫DialB。
什么是错?我需要DilB:OnInitDialog适用于两者。帮助Plz
CDialB代码(从OP非解决方案复制)
Hello all,
in my Appliation I have 2 Dialogs : DialA and DialB
In The DialB::OnInitDialog() I Have some parameters intialization like SetLimitText etc ...
When I call DialB via DialA (by pressing a buttom) the preparameters set on the DialB::OninitDialog() does work. But when i Call DialB from The Menu All works fine.
i even trie to go step by step via debug mode but the prog don''t go the breakpoints when i Call DialB via DialA.
What is Wrong ? I need that the DilB:OnInitDialog Works for both. Help Plz
Code of CDialB (copied from OP non-solution)
BOOL CDialB::OnInitDialog()
{
CDialog::OnInitDialog();
m_Edit_TRIMESTRECTR.SetLimitText(3);
UpdateData(TRUE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
推荐答案
这篇关于OnInitDialog不起作用MFC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!