2003-03-17 08:41:00 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: mfctest.cpp
|
2004-05-25 07:20:37 -04:00
|
|
|
// Purpose: Sample to demonstrate mixing MFC and wxWidgets code
|
2003-03-17 08:41:00 -05:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1998-05-20 10:21:00 -04:00
|
|
|
|
2004-05-25 07:20:37 -04:00
|
|
|
// This sample pops up an initial wxWidgets frame, with a menu item
|
1998-05-20 10:21:00 -04:00
|
|
|
// that allows a new MFC window to be created. Note that CDummyWindow
|
2004-05-25 07:20:37 -04:00
|
|
|
// is a class that allows a wxWidgets window to be seen as a CWnd
|
1998-05-20 10:21:00 -04:00
|
|
|
// for the purposes of specifying a valid main window to the
|
|
|
|
// MFC initialisation.
|
|
|
|
//
|
|
|
|
// You can easily modify this code so that an MFC window pops up
|
2004-05-25 07:20:37 -04:00
|
|
|
// initially as the main frame, and allows wxWidgets frames to be
|
2002-12-17 06:18:09 -05:00
|
|
|
// created subsequently.
|
1998-05-20 10:21:00 -04:00
|
|
|
//
|
2002-12-17 06:18:09 -05:00
|
|
|
// (1) Make MyApp::OnInit not create a main window.
|
|
|
|
// (2) Make MFC's InitInstance create a main window, and remove
|
1998-05-20 10:21:00 -04:00
|
|
|
// creation of CDummyWindow.
|
2002-12-17 06:18:09 -05:00
|
|
|
//
|
|
|
|
// This can be accomplished by setting START_WITH_MFC_WINDOW to 1 below.
|
|
|
|
|
|
|
|
#define START_WITH_MFC_WINDOW 0
|
|
|
|
|
1998-05-20 10:21:00 -04:00
|
|
|
//
|
2000-03-10 06:18:22 -05:00
|
|
|
// IMPORTANT NOTES:
|
|
|
|
//
|
2004-07-30 19:01:04 -04:00
|
|
|
// (1) You may need to set wxUSE_MFC to 1 in include/wx/msw/setup.h but
|
|
|
|
// normally this shouldn't be needed any longer, i.e. it works without
|
|
|
|
// it for me (VZ)
|
2000-03-10 06:18:22 -05:00
|
|
|
//
|
2005-04-16 08:33:50 -04:00
|
|
|
// (2) You should link with MFC DLL, not static libraries: or, to use static
|
|
|
|
// run-time libraries, use this command for both building wxWidgets and
|
|
|
|
// the sample:
|
|
|
|
//
|
|
|
|
// nmake -f makefile.vc BUILD=debug SHARED=0 DEBUG_RUNTIME_LIBS=0 RUNTIME_LIBS=static all
|
|
|
|
//
|
|
|
|
// Unless the run-time library settings match for wxWidgets and MFC, you will get
|
|
|
|
// link errors for symbols such as __mbctype, __argc, and __argv
|
2004-07-30 19:01:04 -04:00
|
|
|
|
|
|
|
#include "stdafx.h"
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
// For compilers that support precompilation, includes "wx/wx.h".
|
|
|
|
#include "wx/wxprec.h"
|
|
|
|
|
|
|
|
#ifdef __BORLANDC__
|
|
|
|
#pragma hdrstop
|
|
|
|
#endif
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
#ifndef WX_PRECOMP
|
|
|
|
#include "wx/wx.h"
|
1998-05-20 10:21:00 -04:00
|
|
|
#endif
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
#include "wx/evtloop.h"
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
#include "mfctest.h"
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// theApp:
|
|
|
|
// Just creating this application object runs the whole application.
|
|
|
|
//
|
|
|
|
CTheApp theApp;
|
|
|
|
|
2004-05-25 07:20:37 -04:00
|
|
|
// wxWidgets elements
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
// Define a new application type
|
|
|
|
class MyApp: public wxApp
|
2004-07-30 19:01:04 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool OnInit();
|
|
|
|
|
|
|
|
wxFrame *CreateFrame();
|
2002-12-17 06:18:09 -05:00
|
|
|
};
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
class MyCanvas: public wxScrolledWindow
|
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
public:
|
1998-05-20 10:21:00 -04:00
|
|
|
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
2002-12-17 06:18:09 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 10:21:00 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class MyChild: public wxFrame
|
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
public:
|
1998-05-20 10:21:00 -04:00
|
|
|
MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
|
2004-07-30 19:01:04 -04:00
|
|
|
virtual ~MyChild();
|
|
|
|
|
1998-05-20 10:21:00 -04:00
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
void OnNew(wxCommandEvent& event);
|
|
|
|
void OnActivate(wxActivateEvent& event);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
|
|
|
MyCanvas *canvas;
|
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 10:21:00 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// ID for the menu quit command
|
|
|
|
#define HELLO_QUIT 1
|
|
|
|
#define HELLO_NEW 2
|
|
|
|
|
|
|
|
DECLARE_APP(MyApp)
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
// notice use of IMPLEMENT_APP_NO_MAIN() instead of the usual IMPLEMENT_APP!
|
|
|
|
IMPLEMENT_APP_NO_MAIN(MyApp)
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
CMainWindow::CMainWindow()
|
|
|
|
{
|
2002-03-17 09:16:03 -05:00
|
|
|
LoadAccelTable( "MainAccelTable" );
|
|
|
|
Create( NULL, "Hello Foundation Application",
|
|
|
|
WS_OVERLAPPEDWINDOW, rectDefault, NULL, "MainMenu" );
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMainWindow::OnPaint()
|
|
|
|
{
|
2002-03-17 09:16:03 -05:00
|
|
|
CString s = "Hello, Windows!";
|
|
|
|
CPaintDC dc( this );
|
|
|
|
CRect rect;
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-03-17 09:16:03 -05:00
|
|
|
GetClientRect( rect );
|
|
|
|
dc.SetTextAlign( TA_BASELINE | TA_CENTER );
|
|
|
|
dc.SetTextColor( ::GetSysColor( COLOR_WINDOWTEXT ) );
|
|
|
|
dc.SetBkMode(TRANSPARENT);
|
|
|
|
dc.TextOut( ( rect.right / 2 ), ( rect.bottom / 2 ),
|
2002-12-17 06:18:09 -05:00
|
|
|
s, s.GetLength() );
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMainWindow::OnAbout()
|
|
|
|
{
|
2002-03-17 09:16:03 -05:00
|
|
|
CDialog about( "AboutBox", this );
|
|
|
|
about.DoModal();
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMainWindow::OnTest()
|
|
|
|
{
|
2004-05-25 07:20:37 -04:00
|
|
|
wxMessageBox("This is a wxWidgets message box.\nWe're about to create a new wxWidgets frame.", "wxWidgets", wxOK);
|
2002-12-17 06:18:09 -05:00
|
|
|
wxGetApp().CreateFrame();
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// CMainWindow message map:
|
|
|
|
// Associate messages with member functions.
|
|
|
|
//
|
|
|
|
// It is implied that the ON_WM_PAINT macro expects a member function
|
|
|
|
// "void OnPaint()".
|
|
|
|
//
|
|
|
|
// It is implied that members connected with the ON_COMMAND macro
|
|
|
|
// receive no arguments and are void of return type, e.g., "void OnAbout()".
|
|
|
|
//
|
|
|
|
BEGIN_MESSAGE_MAP( CMainWindow, CFrameWnd )
|
2002-12-17 06:18:09 -05:00
|
|
|
//{{AFX_MSG_MAP( CMainWindow )
|
|
|
|
ON_WM_PAINT()
|
|
|
|
ON_COMMAND( IDM_ABOUT, OnAbout )
|
|
|
|
ON_COMMAND( IDM_TEST, OnTest )
|
|
|
|
//}}AFX_MSG_MAP
|
1998-05-20 10:21:00 -04:00
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
BOOL CTheApp::InitInstance()
|
|
|
|
{
|
2004-07-30 19:01:04 -04:00
|
|
|
if ( !CWinApp::InitInstance() )
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
// TODO: cmd line parsing
|
|
|
|
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
|
|
|
wxSetInstance(m_hInstance);
|
|
|
|
wxApp::m_nCmdShow = m_nCmdShow;
|
|
|
|
int argc = 0;
|
|
|
|
char **argv = NULL;
|
|
|
|
wxEntryStart(argc, argv);
|
|
|
|
if ( !wxTheApp || !wxTheApp->CallOnInit() )
|
|
|
|
return FALSE;
|
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
#if START_WITH_MFC_WINDOW
|
|
|
|
// Demonstrate creation of an initial MFC main window.
|
2002-03-17 09:16:03 -05:00
|
|
|
m_pMainWnd = new CMainWindow();
|
|
|
|
m_pMainWnd->ShowWindow( m_nCmdShow );
|
|
|
|
m_pMainWnd->UpdateWindow();
|
2004-07-30 19:01:04 -04:00
|
|
|
#else
|
2004-05-25 07:20:37 -04:00
|
|
|
// Demonstrate creation of an initial wxWidgets main window.
|
|
|
|
// Wrap wxWidgets window in a dummy MFC window and
|
2002-12-17 06:18:09 -05:00
|
|
|
// make the main window.
|
1998-05-20 10:21:00 -04:00
|
|
|
if (wxTheApp && wxTheApp->GetTopWindow())
|
|
|
|
{
|
|
|
|
m_pMainWnd = new CDummyWindow((HWND) wxTheApp->GetTopWindow()->GetHWND());
|
|
|
|
}
|
2002-12-17 06:18:09 -05:00
|
|
|
#endif
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-03-17 09:16:03 -05:00
|
|
|
return TRUE;
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int CTheApp::ExitInstance()
|
|
|
|
{
|
2004-07-30 19:05:53 -04:00
|
|
|
#if !START_WITH_MFC_WINDOW
|
|
|
|
delete m_pMainWnd;
|
|
|
|
#endif
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
if ( wxTheApp )
|
|
|
|
wxTheApp->OnExit();
|
|
|
|
wxEntryCleanup();
|
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
return CWinApp::ExitInstance();
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
// Override this to provide wxWidgets message loop compatibility
|
1998-05-20 10:21:00 -04:00
|
|
|
BOOL CTheApp::PreTranslateMessage(MSG *msg)
|
|
|
|
{
|
2004-07-30 19:01:04 -04:00
|
|
|
wxEventLoop *evtLoop = wxEventLoop::GetActive();
|
|
|
|
if ( evtLoop && evtLoop->PreProcessMessage(msg) )
|
2002-12-17 06:18:09 -05:00
|
|
|
return TRUE;
|
2004-07-30 19:01:04 -04:00
|
|
|
|
|
|
|
return CWinApp::PreTranslateMessage(msg);
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
BOOL CTheApp::OnIdle(LONG WXUNUSED(lCount))
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2004-07-30 19:01:04 -04:00
|
|
|
return wxTheApp && wxTheApp->ProcessIdle();
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2004-05-25 07:20:37 -04:00
|
|
|
* wxWidgets elements
|
2002-12-17 06:18:09 -05:00
|
|
|
********************************************************************/
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
bool MyApp::OnInit()
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
#if !START_WITH_MFC_WINDOW
|
|
|
|
|
|
|
|
// Exit app when the top level frame is deleted
|
|
|
|
SetExitOnFrameDelete(TRUE);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
(void) CreateFrame();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return TRUE;
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
wxFrame *MyApp::CreateFrame()
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
MyChild *subframe = new MyChild(NULL, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300),
|
|
|
|
wxDEFAULT_FRAME_STYLE);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2004-05-25 07:20:37 -04:00
|
|
|
subframe->SetTitle("wxWidgets canvas frame");
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
// Give it a status line
|
|
|
|
subframe->CreateStatusBar();
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
// Make a menubar
|
|
|
|
wxMenu *file_menu = new wxMenu;
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
file_menu->Append(HELLO_NEW, "&New MFC Window");
|
|
|
|
file_menu->Append(HELLO_QUIT, "&Close");
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
wxMenuBar *menu_bar = new wxMenuBar;
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
menu_bar->Append(file_menu, "&File");
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
// Associate the menu bar with the frame
|
|
|
|
subframe->SetMenuBar(menu_bar);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
int width, height;
|
|
|
|
subframe->GetClientSize(&width, &height);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
2002-12-17 06:18:09 -05:00
|
|
|
MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height));
|
|
|
|
canvas->SetCursor(wxCursor(wxCURSOR_PENCIL));
|
2004-07-30 19:01:04 -04:00
|
|
|
subframe->canvas = canvas;
|
2002-12-17 06:18:09 -05:00
|
|
|
subframe->Show(TRUE);
|
|
|
|
|
|
|
|
// Return the main frame window
|
|
|
|
return subframe;
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
|
|
|
EVT_PAINT(MyCanvas::OnPaint)
|
|
|
|
EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
// Define a constructor for my canvas
|
2004-07-30 19:01:04 -04:00
|
|
|
MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size)
|
|
|
|
: wxScrolledWindow(parent, -1, pos, size)
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Define the repainting behaviour
|
2004-07-30 19:01:04 -04:00
|
|
|
void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
|
|
|
wxPaintDC dc(this);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
1999-02-04 17:06:15 -05:00
|
|
|
dc.SetFont(* wxSWISS_FONT);
|
1999-02-04 16:12:30 -05:00
|
|
|
dc.SetPen(* wxGREEN_PEN);
|
1998-05-20 10:21:00 -04:00
|
|
|
dc.DrawLine(0, 0, 200, 200);
|
|
|
|
dc.DrawLine(200, 0, 0, 200);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
1999-02-04 16:12:30 -05:00
|
|
|
dc.SetBrush(* wxCYAN_BRUSH);
|
|
|
|
dc.SetPen(* wxRED_PEN);
|
1998-05-20 10:21:00 -04:00
|
|
|
dc.DrawRectangle(100, 100, 100, 50);
|
|
|
|
dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
|
2004-07-30 19:01:04 -04:00
|
|
|
|
1998-05-20 10:21:00 -04:00
|
|
|
dc.DrawEllipse(250, 250, 100, 50);
|
|
|
|
dc.DrawLine(50, 230, 200, 230);
|
|
|
|
dc.DrawText("This is a test string", 50, 230);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This implements a tiny doodling program! Drag the mouse using
|
|
|
|
// the left button.
|
|
|
|
void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
|
|
|
{
|
2004-07-30 19:01:04 -04:00
|
|
|
static long s_xpos = -1;
|
|
|
|
static long s_ypos = -1;
|
|
|
|
|
1998-05-20 10:21:00 -04:00
|
|
|
wxClientDC dc(this);
|
1999-02-04 16:12:30 -05:00
|
|
|
dc.SetPen(* wxBLACK_PEN);
|
2000-03-10 06:18:22 -05:00
|
|
|
wxPoint pos = event.GetPosition();
|
2004-07-30 19:01:04 -04:00
|
|
|
if (s_xpos > -1 && s_ypos > -1 && event.Dragging())
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2004-07-30 19:01:04 -04:00
|
|
|
dc.DrawLine(s_xpos, s_ypos, pos.x, pos.y);
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
2004-07-30 19:01:04 -04:00
|
|
|
|
|
|
|
s_xpos = pos.x;
|
|
|
|
s_ypos = pos.y;
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(MyChild, wxFrame)
|
|
|
|
EVT_MENU(HELLO_QUIT, MyChild::OnQuit)
|
|
|
|
EVT_MENU(HELLO_NEW, MyChild::OnNew)
|
|
|
|
EVT_ACTIVATE(MyChild::OnActivate)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
MyChild::MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, const long style)
|
|
|
|
: wxFrame(frame, -1, title, pos, size, style)
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
canvas = NULL;
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
MyChild::~MyChild()
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2004-07-30 19:05:53 -04:00
|
|
|
if ( IsLastBeforeExit() )
|
|
|
|
PostQuitMessage(0);
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
|
|
|
Close(TRUE);
|
|
|
|
}
|
|
|
|
|
2004-07-30 19:01:04 -04:00
|
|
|
void MyChild::OnNew(wxCommandEvent& WXUNUSED(event))
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
|
|
|
CMainWindow *mainWin = new CMainWindow();
|
|
|
|
mainWin->ShowWindow( TRUE );
|
|
|
|
mainWin->UpdateWindow();
|
|
|
|
}
|
2002-12-17 06:18:09 -05:00
|
|
|
|
1998-05-20 10:21:00 -04:00
|
|
|
void MyChild::OnActivate(wxActivateEvent& event)
|
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
if (event.GetActive() && canvas)
|
|
|
|
canvas->SetFocus();
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Dummy MFC window for specifying a valid main window to MFC, using
|
2004-05-25 07:20:37 -04:00
|
|
|
// a wxWidgets HWND.
|
2004-07-30 19:05:53 -04:00
|
|
|
CDummyWindow::CDummyWindow(HWND hWnd)
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
Attach(hWnd);
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Don't let the CWnd destructor delete the HWND
|
2004-07-30 19:01:04 -04:00
|
|
|
CDummyWindow::~CDummyWindow()
|
1998-05-20 10:21:00 -04:00
|
|
|
{
|
2002-12-17 06:18:09 -05:00
|
|
|
Detach();
|
1998-05-20 10:21:00 -04:00
|
|
|
}
|
|
|
|
|