Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,


I want to Create a Window. I proceed with the Following Code.

C++
CString wndclass = ::AfxRegisterWndClass(CS_DBLCLKS,::LoadCursor(NULL, IDC_ARROW),
        ::GetSysColorBrush(COLOR_BTNFACE), 0);
 
 if (!CWnd::Create(wndclass, lpszWindowName,dwStyle,CRect(0, 0, 0, 0), pParentWnd, nID))
   return FALSE;  //-------------> Not able to Create Window Here.



CWnd::Create should return True instead it is giving False.


Please let me know where i am going wrong.

Thanks
Uday.
Posted
Updated 21-Aug-13 23:17pm
v2
Comments
pasztorpisti 22-Aug-13 5:36am    
Are you running the program on the same Windows version?

1 solution

check the styles and try a bigger CRect. What does GetLastError() returning?
 
Share this answer
 
Comments
janaswamy uday 23-Aug-13 1:53am    
"Invalid window handle." message is getting for GetLastError().

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900