Re: how we can generate CWnd * from Dialog ID(IDD_DIALOG1)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



thnx for replying
but actually i want to invoke user
defined function corresponding Dialog Box IDD_DIALOG1 through
SendMessage() from another Dialog Class , there is no relationship
between these two dialog Class. So that i require a CWnd * of Dialog
Box IDD_DIALOG1 to invoke that user defined function
David Wilkinson wrote:

raghunandan_1081@xxxxxxxxx wrote:

Hi Guys, How r u, can you please tell me how we can generate CWnd *
from Dialog ID(IDD_DIALOG1) , I have used GetDlgItem() but this
function is for Window Control on Dialog Box not for Dialog ID. Please
tell me i am waiting for your reply.


raghunandan:

CWnd is the base class of CDialog.

So if you have a dialog class (derived from CDialog) associated with
your template, and have created the dialog using DoModal() or Create(),
then in any method of the dialog you can so

CWnd* pWnd = this;

David Wilkinson

.