Solved

HWND create handle for window

Posted on 2000-02-14
2
843 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:alexott
2 Comments
 
LVL 12

Expert Comment

by:migel
ID: 2517935
Hi!
pls show your code
do you check Create returns?
0
 
LVL 8

Accepted Solution

by:
VinExpert earned 50 total points
ID: 2518156
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 122
iSeries FTP Exit Program 8 114
maxBlock challenge 30 99
firstChar challenge 13 83
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now