gpt4 book ai didi

c++ - 使用 dev C++ 将文本输入框添加到 C++ gui

转载 作者:行者123 更新时间:2023-11-28 07:25:29 24 4
gpt4 key购买 nike

我正在使用 dev c++ 标准 Windows 应用程序模板,并且对 gui 编程是全新的,我什至不知道从哪里开始。我在网上查看了示例,并尝试将 L"Edit"添加到以下代码中:

hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);

然而,当我尝试添加它时,它给了我这个错误。 从 const char*' 到 DWORD' 的无效转换 有什么地方可以让我学习如何仅使用 dev c++ 来完成此操作吗?我实际上想学习如何从头开始做这件事,不想使用构建器。对于那些使用 dev c++ 的人,我如何将文本输入框添加到他们拥有的标准 Windows gui 模板?

最佳答案

您对 CreateWindowEx 的参数之一一定是错误的。错误在哪一行?还有更多信息吗?您应该查阅 MSDN 上的文档:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680(v=vs.85).aspx

如果您完全不熟悉 UI 编程,我建议您下载 Visual Studio Express for Desktop。它有一个可视化 UI 设计器,让您可以使用 Visual Basic、C# 或 Visual C++ 进行编程。您获得的程序将不是 native Win32 应用程序;它们在 .NET 虚拟机上运行,​​但这很好。您也可以看到设计器生成的源代码。

关于c++ - 使用 dev C++ 将文本输入框添加到 C++ gui,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18806486/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com