CWnd :: Create with CtrlID = null mig [英] CWnd::Create with CtrlID=null mig
本文介绍了CWnd :: Create with CtrlID = null mig的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我将C ++/MFC 2005项目迁移到VS2010,并且有一个此类调用的类:
Hello,
I migrate a C++/MFC 2005 project to VS2010 and there is a class with this call:
CWnd::Create((LPCSTR)wndstr, "GridClass", dwStyle, grid_rect, pParentWnd, /*nID*/NULL, NULL);
/* .... */
int nID( ::GetDlgCtrlID( this->m_hWnd ) );
期望(VS2005)nID为0,但是在VS2010中,GetDlgCtrlID调用返回一个非null值.有人知道吗?
There are expect (VS2005) that nID is 0, but in VS2010 the GetDlgCtrlID-call returns a non null value. Does anyone know something about this? Is there a known way to create an object from a CWnd-based class with a null-value CtrlID?
推荐答案
对不起,谁告诉你它应该是?
首先是此API的代码示例:
http://msdn.microsoft.com/en-us/library/0yhc9kx4%28v = VS.100%29.aspx [ ^ ].
ID的含义在这里说明:
http://www.codeguru.com/forum/showthread.php?t=344170 [ ^ ].
-SA
Excuse me, who told you it should beNULL
?
First at the code sample for this API:
http://msdn.microsoft.com/en-us/library/0yhc9kx4%28v=VS.100%29.aspx[^].
The meaning of ID is explained here:
http://www.codeguru.com/forum/showthread.php?t=344170[^].
—SA
根据 ^ ]在MSDN上返回值为零表示错误.
According to the documentation[^] on MSDN a return value of zero indicates an error.
这篇关于CWnd :: Create with CtrlID = null mig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文