HWND create handle for window

After creating a CWnd-object on the heap I get an assertion-failure according to the ASSERT-function in CWnd::ShowWindow, because the m_hWnd is not defined. But I did the CWnd::Create-Command.
alexottAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Vinayak KumbarConnect With a Mentor Sr Program ManagerCommented:
HI,

Check whether  U R doing something like this
In the header file
CWnd *pWnd;

In the cpp file
in constructor
pWnd = NULL;

When creating
CRect rect(10,10,200,200);
pWnd = new CWnd;
pWnd->Create(NULL, "MTV", WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU, rect, this, 4545, NULL);
pWnd->ShowWindow(SW_SHOW);

It is working.
Try it out.
VinExpert
0
 
migelCommented:
Hi!
pls show your code
do you check Create returns?
0
All Courses

From novice to tech pro — start learning today.