请问如何在本机C ++程序中创建一个对话框? [英] Please how do i make a dialogue box my main window in a native C++ program?

查看:98
本文介绍了请问如何在本机C ++程序中创建一个对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问如何在本机c ++程序中创建一个主窗口对话框?

Please how do I make a dialogue box my main window in a native c++ program?

推荐答案

你不能,但你可以创建一个什么都不做的Windows应用程序但在关闭对话框时会显示一些对话框并退出。使用指定的对话框函数调用函数 DialogBox 。整个应用程序将被执行,直到您的对话框函数通过调用 EndDialog 来终止它。请参阅:

http ://msdn.microsoft.com/en-us/library/windows/desktop/ms645452%28v=vs.85%29.aspx [ ^ ],

< a href =http://msdn.microsoft.com/en-us/library/windows/desktop/ms645472(v=vs.85).aspx> http://msdn.microsoft.com/en-us/ library / windows / desktop / ms645472(v = vs.85).aspx [ ^ ]。



-SA
You cannot, but you can create a Windows application which does nothing but shows some dialog and exits when the dialog is closed. Call the function DialogBox with specified dialog function. The whole application will be executed until your dialog function terminates it by calling EndDialog. Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms645452%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms645472(v=vs.85).aspx[^].

—SA


听起来好像你有一个基于视图的项目/应用程序,并希望将其转换为对话框应用程序。



有很多细节有点太复杂,无法在此解释。用几句话解释它的最简单方法是打开Visual Studio,创建2个项目,一个是基于视图的hello world应用程序,另一个是基于对话框的项目。尽可能使用相同的设置(例如,使用ATL,Unicode等)。项目可以在同一个解决方案中。使用差异工具(包括.cpp,.h和.vcxproj)查看项目中的结果文件,并根据这些差异将真实项目从视图样式转换为对话框样式。



罗伯特是你母亲的兄弟。
It sounds as if you have a view based project/application and want to convert it to a dialog app.

There are a lot of details that are a bit too complex to explain here. The easiest way to explain it in a few words is to open Visual Studio, and create 2 projects, one being a view based "hello world" app, the other being a dialog based project. Use the same settings for both as much as possible (eg. use of ATL, Unicode etc.). The projects can be in the same solution. Look at the resulting files in the project wit a differences tool (including .cpp, .h and .vcxproj) and convert your 'real' project from view style to dialog style, based on these differences.

Robert is your mother's brother.


这篇关于请问如何在本机C ++程序中创建一个对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆