错误C2440:"=":无法从"HWND"转换为"HINSTANCE" [英] error C2440: '=' : cannot convert from 'HWND' to 'HINSTANCE'

查看:165
本文介绍了错误C2440:"=":无法从"HWND"转换为"HINSTANCE"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ghMDIClientArea = CreateWindow(TEXT("MDICLIENT"), // predefined value for MDI client area
                           NULL, // no caption required
                           WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
                           0, // No need to give any x/y or height/width since this client
                              // will just be used to get client windows created, effectively
                              // in the main window we will be seeing the mainframe window client area itself.
                           0,
                           0,
                           0,
                           hwnd,
                           NULL,
                           ghInstance,
                           (void *) &MDIClientCreateStruct);



在te代码中遇到此错误,请尽快提供帮助
错误C2440:"=":无法从"HWND"转换为"HINSTANCE"



getting this error in te code please help asap
error C2440: ''='' : cannot convert from ''HWND'' to ''HINSTANCE''

推荐答案

请参阅我对问题的评论.提出问题并隐藏导致问题的声明不是很好.

无论如何,您只是尝试使用一些不相关的类型,以名称ghMDIClientArea进行判断-出于某种原因,这是非常不相关的,只有您可以知道.查看CreateWindow的声明:
http://msdn.microsoft.com/zh-我们/library/windows/desktop/ms632679%28v=vs.85%29.aspx [
Please see my comment to the question. It''s not nice to ask a question and hide the declaration which caused the problem.

Anyway, you just trying to work with some unrelated types, judging by the name ghMDIClientArea — very unrelated, by some reason which only you can know. Look at the declaration of CreateWindow:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632679%28v=vs.85%29.aspx[^].

Return type is HWND (window handle), so declare appropriate variable to represent it.

By the way, who needs MDI? This UI style is highly discouraged even by Microsoft. Why torturing yourself and chase out your customers?

—SA


这篇关于错误C2440:"=":无法从"HWND"转换为"HINSTANCE"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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