如何将组合框放入我的C++动态库中
How to put Combo Box in my C++ dynamic library?
我是C++编程新手,基本上我是 VB.net 程序员。 我需要将组合盒放在我的C++动态库中。 我的C++动态库将调用我的 VB.Net 函数。 我想在动态库加载并选择项目时显示组合框弹出窗口C++。
我已经戴上了护目镜并尝试遵循MSDN参考中的代码
// Create the Combobox
//
// Uses the CreateWindow function to create a child window of
// the application window. The WC_COMBOBOX window style specifies
// that it is a combobox.
int xpos = 100; // Horizontal position of the window.
int ypos = 100; // Vertical position of the window.
int nwidth = 200; // Width of the window
int nheight = 200; // Height of the window
HWND hwndParent = m_hwnd; // Handle to the parent window
HWND hWndComboBox = CreateWindow(WC_COMBOBOX, TEXT(""),
CBS_DROPDOWN | CBS_HASSTRINGS | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE,
xpos, ypos, nwidth, nheight, hwndParent, NULL, HINST_THISCOMPONENT,
NULL);
但是我收到以下错误:
error C2065: 'm_hwnd' : undeclared identifier
error C2065: 'HINST_THISCOMPONENT' : undeclared identifier
您的帮助将非常可观。
提前感谢!
查看链接页面上的完整示例,我们发现您复制和粘贴的代码段是较大类的一部分。此类包括 m_hwnd
成员变量之类的内容。完整的示例还包括 HINST_THISCOMPONENT
的宏定义。
如果我使用的术语("类","成员变量","宏")对您没有意义,我建议您查看The Definitive C++ Book Guide and List。这是C++大师在StackOverflow上收集的非常好的学习C++书籍列表。
对于Win32 GUI编程,我推荐Charles Petzold的Programming Windows,第五版。
尝试一次学习一个C++或Win32 GUI编程一个StackOverflow问题将是痛苦的。
相关文章:
- 我的神经网络不起作用 [XOR 问题]
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 我的字符计数代码计算错误.为什么
- 为什么我的C#代码在调用回C++COM直到Task时会暂停.等待/线程.加入
- cmake在我的项目中所需的所有静态库都不成功
- 为什么我的代码在输出中增加了93天
- 我的简单if-else语句是如何无法访问的代码
- 为什么我的for循环不能正确获取argv
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 0-1背包代码中的错误.我的代码中有什么错误
- 当我的阵列太大时出现分段错误
- 如何确认我的constexpr表达式实际上已经在编译时执行
- 为什么二进制搜索在我的测试中不起作用
- 如何指定我希望我的LIB链接到的DLL文件?-Visual Studio 2019
- 我的代码中有错误吗?使用BGI图形的C++代码对我不起作用
- 当我在main中声明了我的2d数组时,为什么我的程序会退出
- OpenGL在启用深度测试时不会丢弃我的碎片
- 为什么我的 std::ref 无法按预期工作?
- clang整洁10忽略了我的NOLINT命令
- 为什么我的删除节点函数实际上没有删除节点?