HighTechTalks DotNet Forums  

handle to Dialog box

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss handle to Dialog box in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Zoe
 
Posts: n/a

Default handle to Dialog box - 07-25-2003 , 07:03 PM






Hello, I am fairly new to c++.net programming. In my
program, I'm trying to create a CButton object through a
dialog box. I want to create this object during run-time.
In the view class, I have the following:


void CdialogView::OnOpenDialogBox()
{
// TODO: Add your command handler code here
CDialogBox dlg;
dlg.DoModal();
}

In the CDialogBox class I used to following code:

// Create a push button.
HWND hWnd=this->m_hWnd; //Handle to dialog box

CButton myButton;

BOOL b= myButton.Create(_T("My button"),
WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), (CWnd*)&hWnd,100000);


The boolean value b returns FALSE. THe only problem I can
see with this is the dialog boxes's handle, this->m_hWnd,
because the Create function requires this variable. Did I
use the right handle?

Thanks!


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.