Re: About HWND of the dialog in the CDiloag based class
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 02/24/04
- Next message: Bob: "first chance exception"
- Previous message: Steve Russell: "Re: typedef in header files"
- In reply to: Jeff Partch: "Re: About HWND of the dialog in the CDiloag based class"
- Next in thread: Joseph M. Newcomer: "Re: About HWND of the dialog in the CDiloag based class"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 23 Feb 2004 20:37:46 -0500
You might also want to check out my essays on dialog boxes on my MVP Tips site. But it
sounds like you are trying to shoehorn some old Win32 native programming knowledge into
MFC, where the framework handles most of these details for you. For example, the very
existence of the MainDialog function for what I'm guessing to be a dialog-based app
suggests that you have gotten very lost along the way. An MFC-based dialog app would have
a dialog subclass that handled this, and it would have a message map to handle all the
message dispatches. Consequently, most of the questions you are asking become quite
different.
joe
On Mon, 23 Feb 2004 18:40:05 -0600, "Jeff Partch" <jeffp@mvps.org> wrote:
>"Jitesh Virani" <jiteshvirani2004@yahoo.co.in> wrote in message
>news:008401c3fa60$35de2060$a301280a@phx.gbl...
>> Hello Jeff Partch,
>>
>> If MainDialog function seems incompatible with
>> MFC, which alternative is available in MFC for this?
>> You have suggested me to use GetDlgCtrlID function
>> but the syntas of this function says:
>> int GetDlgCtrlID(
>> HWND hwndCtl
>> );
>
>Not necessarily incompatible, just oddly prototyped for what it appears to
>be and rather unusual.
>
>> How do I get this HWND of the control?
>
>You can use GetDlgItem, or you can use VC wizards to map the HWND to a
>control member variable. MFC wraps alot of the Win32 API ways of doing
>things in C++ classes and member functions that automatically provide the
>HWND or whatever. For example, CWnd::GetDlgCtrlID does not need the HWND
>parameter, but it needs a CWnd that has been attached to the HWND.
>
>> I want to manipulate the text that is entered at
>> runtime into TextBox with specific property. In the same
>
>This TextBox is an EDIT control? If so, CWnd::SetWindowText and
>CWnd::GetWindowText come immediately to mind. There are also CEdit member
>functions that wrap the EM_xxx messages. There is also CWnd::SetDlgItemText
>and CWnd::GetDlgItemText. I'm not sure how you intend to manipulate the
>text, so I'm not sure which exactly would be best.
>
>> way, I want to make use of the selected text of ComboBox
>> at runtime by the user through one of it's properties. I
>
>You should look at the CListBox member functions and see if any of those
>offer the information you want to set or get.
>
>> am referring to the term property as per the vb
>> convension. It is possible that in VC it may have other
>> nameing convension. As I am new to VC programming that I
>> am somewhat unable to explain my problem to you.
>> I mean to say Is it possible for me to get the
>> HWND of DialogBox, in the class which has the declaration
>> like MyDialog::CDialog.
>
>Yes, in the CDialog derived class you can use the m_hWnd member variable.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Bob: "first chance exception"
- Previous message: Steve Russell: "Re: typedef in header files"
- In reply to: Jeff Partch: "Re: About HWND of the dialog in the CDiloag based class"
- Next in thread: Joseph M. Newcomer: "Re: About HWND of the dialog in the CDiloag based class"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|