CDialog ShowWindow问题
我有一个 SDI 应用程序。在应用程序中,有一个无模式对话框,用于显示一些消息,例如在工作期间与服务器通信。问题是,当对话框的父窗口设置为主框架时,ShowWindow 方法无法按预期工作。看起来对话框被主框架覆盖了。如果我将 Sleep 调用放在 ShowWindow 调用旁边,我就可以看到该对话框。当睡眠结束时,对话框消失。如果我不设置对话框的父级,则 ShowWindow 调用正常工作。但我确实想设置对话框的父窗口。那么如何解决呢?
I have a SDI application. In the application there's a modeless dialog which is used to show some message like communicating with the server during doing work. Question is, when the dialog's parent window is set to main frame, the ShowWindow method doesn't work as expected. It seems that the dialog is covered by the main frame. If I put a Sleep call next to ShowWindow call, I can see the dialog. And when Sleep ends, the dialog disappear.If I don't set the dialog's parent, the ShowWindow call works normally. But I do want to set the dialog's parent window. So how to sovle it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“睡眠”使其工作一段时间的事情让我认为您正在堆栈上创建对话框,并且它超出了范围,因此会破坏自身。
The thing with the 'sleep' making it work for a while makes me think you're creating the dialog on the stack and it's going out of scope, therefore destroying itself.