问题描述
大家好
这个问题有点奇怪或可能是真的但我不知道解决方案。
我是使用MFC,我刚刚创建了一个示例项目,其中创建了三个对话框
1. DLG_MAIN
2. DLG_DADDY(包含/实现的类CDaddy )
3. DLG_SON(包含类/实现CSon)
在DLG_MAIN中添加了一个按钮,表示CALL_BTN_DADDY
在DLG_DADDY中添加一个按钮说CALL_BTN_SON
现在在代码和执行步骤中
注意:父类已相应地传递给了课程。
1.当用户点击CALL_BTN_DADDY按钮时,将弹出DLG_DADDY。
2.现在在DLG_DADDY中,如果用户单击CALL_BTN_SON,则会出现DLG_SON。
3.在CSon :: OnintDialog()中请写AfxMessageBox(_T(hi))
结果
注意:MessageBox工作正常,所以我的要求是只使用AfxmessageBox
1.消息将出现在对话框弹出窗口之前。嗯,这也是我的要求。
2.点击OK后,DLG_SON变为MODELLESS。我的意思是我可以关闭DLG_DADDY而不关闭DLG_SON。
我用Google搜索只能使用messagebox而不是afxmessagebox。 但这不是我的要求。
你有解决方案或建议吗?
提前感谢
Hi all
This problem is little bit weird or may be genuine but i don't know the solution.
I am using MFC and I just created a sample project in which three dialog created
1. DLG_MAIN
2. DLG_DADDY (class included/implemented CDaddy)
3. DLG_SON (class included/implemented CSon)
In DLG_MAIN one button added say CALL_BTN_DADDY
In DLG_DADDY one button added say CALL_BTN_SON
Now in Code and execution steps
Note: Parent has been Passed accordingly to class.
1. When user click on CALL_BTN_DADDY button DLG_DADDY will popup.
2. Now in DLG_DADDY if user click CALL_BTN_SON then DLG_SON will appear.
3. In CSon::OnintDialog() please write AfxMessageBox(_T("hi"))
Result
Note: MessageBox is working fine so my requirment is to use only AfxmessageBox
1. Message will appear before dialog popup. Well it is my requirement too.
2. After clicking OK the DLG_SON become MODELLESS. i mean i can close DLG_DADDY with out closing DLG_SON.
what i googled got only to use messagebox instead of afxmessagebox. But that is not my requrment.
Do you have the solution or suggestion.
thanks in advance
推荐答案
这篇关于afxMessageBox(_T(" hi"))oninitdialog()中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!