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 30-Sep-2009, 11:32
esc123 esc123 is offline
New Member
 
Join Date: Sep 2009
Posts: 1
esc123 is on a distinguished road

Creating a new Window: m_hWnd not initializing?


Hello,

I am creating a new window in MFC and have found out that the m_hWnd is not getting initialized. Here is my code:

CPP / C++ / C Code:
void MainDialog::OnBnClickedButton1()

	{
        NewDialog *dlg;
	dlg = new NewDialog( this );
	dlg->Create(IDD_NewDialog);
	dlg->ShowWindow(1);
        }

This goes to a new .cpp where i am calling a SetTimer() function as:

CPP / C++ / C Code:
NewDialog::NewDialog(MainDialog* dlg)

        {
	CDialog(NewDialog::IDD, NULL);
	SetTimer(777, 1, NULL);
        }

Where I get a debug error as:

m_hWnd 0x00000000 {unused=??? } HWND__ *
__________________________________________________ _______________
My overall question is: Why isn't m_hWnd getting initialized? Thanks for any help on this topic.
Last edited by LuciWiz : 30-Sep-2009 at 11:37. Reason: Please insert your C++ code between [cpp] & [/cpp] tags; Removed personal information
  #2  
Old 09-Oct-2009, 07:54
pur pur is offline
New Member
 
Join Date: Oct 2009
Posts: 3
pur is on a distinguished road

Re: Creating a new Window: m_hWnd not initializing?


have you tried

INT_PTR result = dlg->DoModal();

instead of the showwindow
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

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
Error compiling Apache 2.2.10 tiagofgarcia Apache Web Server Forum 2 10-Nov-2009 14:31
Traditional Win32 programming vs. wxWidgets Zorachus C++ Forum 2 10-Feb-2007 18:54
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 15:46
Win32 Window Shading behavior (like linux) WillyumYum C++ Forum 3 18-Apr-2005 15:36
Changing window start colour Rosdahale C++ Forum 5 19-Jan-2005 16:51

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

All times are GMT -6. The time now is 17:20.


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