Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Destroying a Window Question

Posted on 2003-03-13
4
Medium Priority
?
188 Views
Last Modified: 2010-04-01
Hi:

If I do this, how do I destroy the Window? THe following does not work, obviously. I need to somehow destroy the main window.

////////////////////////////////////////////////////////////////////////////
// Define a window class derived from CFrameWnd
class CConsleWindow : public CFrameWnd
{
public:
     CConsleWindow()
          { Create(NULL, _T("Console"), WS_OVERLAPPEDWINDOW, rectDefault); }
};

/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// CconsoleApp initialization

BOOL CconsoleApp::InitInstance()
{

m_pMainWnd = new CConsleWindow();

}


On logout (When a user logs out):

DestroyWindow(m_pMainWnd);  //I am trying to destroy the window here

I tried Cwnd::DestroyWindow(); but, this is not it either...

Please help.

Thanks,
Doug

0
Comment
Question by:DougC
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:DougC
ID: 8130567
Actually, I want to get rid of the instance of CconsoleApp.
Any ideas?

Thanks,
Doug
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 8131812


If it's not :m_pMainWnd->DestroyWindow()", then check the CFrameWnd class for a Close() or Destroy() method.


0
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 80 total points
ID: 8131817
That should be:

 m_pMainWnd->DestroyWindow()
0
 
LVL 1

Author Comment

by:DougC
ID: 8132098
Works like a champ!! Thanks!!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

571 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