GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Apr-2009, 12:42
abugg abugg is offline
New Member
 
Join Date: Apr 2009
Posts: 1
abugg is on a distinguished road

Create and Show multiple CFrameWnd objects


Hi,

I have created a CFrameWnd based class (CControlFrame) with many buttons, CEdits, etc.
I have successfully created and one instance of my CControlFrame class with the following code:
CPP / C++ / C Code:
CGenerator pattern1;
		CControlFrame* myFrame1 = new CControlFrame(pattern1, 1);
		if (!myFrame1->Create(NULL, L"Control Window #1", WS_OVERLAPPEDWINDOW,
			CRect(0,0,256,768)))
		{
			// free the memory and return
			delete myFrame1;
			return FALSE;
		}
		myFrame1->ShowWindow(1);

m_pMainWnd = myFrame1;

I am attempting to create a 2nd CControlFrame object to display simultaneously with the following code for the 2nd object.
CPP / C++ / C Code:
CGenerator pattern2;
		CControlFrame* myFrame2 = new CControlFrame;
		
		if (!myFrame2->Create(NULL, L"Control Window #2", WS_OVERLAPPEDWINDOW,
			CRect(256,0,512,768),myFrame1->GetTopLevelFrame()))
		{
			// free the memory and return
			delete myFrame2;
			return FALSE;
		}
		myFrame2->ShowWindow(1);
An Assert error is produced while attempting to create the myFrame2
CPP / C++ / C Code:
ASSERT(pWnd->m_hWnd == NULL);   // only do once
I am guessing this is because the pointer is already pointing to the myFrame1?

The goal is for each frame to contain identical controls and layout with the ability to modify their own variables.

If this is the incorrect solution for such a problem, please let me know and possibly suggest an alternative approach?

Otherwise, any wild guesses, or advice would be greatly appreciated!
 
 

Recent GIDBlogVista ?Widgets? on Windows XP by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FLTK && fluid In Motion cable_guy_67 FLTK Forum 4 20-Mar-2008 03:52
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 14:46
Simple FLTK dialog box sample cable_guy_67 FLTK Forum 4 02-Nov-2004 08:46

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:43.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.