Dialog Based App Question 
Author Message
 Dialog Based App Question

I have created the simplest Dialog Based App with Wizard.

It has one control , a simple Button1 with it set to default.  I would like
to have the screen painted as normal and start executing code in the
OnButton1() function.

Everything I try, executes the OnButton1 code, but does not draw my main
dialog screen first.

Hummmmm, I'm sure there will be other questions but for now, I'm stumped.

Thanks,

--
Fritz Switzer



Thu, 16 Sep 2004 13:01:28 GMT  
 Dialog Based App Question
In your OnInitDialog() function post the BN_CLICK message and let the
standard CDialog paint the dialog box, when it is done, you will get the
click message and all should work fine.


Quote:
> I have created the simplest Dialog Based App with Wizard.

> It has one control , a simple Button1 with it set to default.  I would
like
> to have the screen painted as normal and start executing code in the
> OnButton1() function.

> Everything I try, executes the OnButton1 code, but does not draw my main
> dialog screen first.

> Hummmmm, I'm sure there will be other questions but for now, I'm stumped.

> Thanks,

> --
> Fritz Switzer




Thu, 16 Sep 2004 19:58:47 GMT  
 Dialog Based App Question
Thanks Douglas,

But where do I get that message to post?

I went looking for something in the Class Wizard and nothing looked
familiar.

Do you mean something like ON_BN_CICKED(id,memfxn) ?


Quote:
> In your OnInitDialog() function post the BN_CLICK message and let the
> standard CDialog paint the dialog box, when it is done, you will get the
> click message and all should work fine.



> > I have created the simplest Dialog Based App with Wizard.

> > It has one control , a simple Button1 with it set to default.  I would
> like
> > to have the screen painted as normal and start executing code in the
> > OnButton1() function.

> > Everything I try, executes the OnButton1 code, but does not draw my main
> > dialog screen first.

> > Hummmmm, I'm sure there will be other questions but for now, I'm
stumped.

> > Thanks,

> > --
> > Fritz Switzer




Thu, 16 Sep 2004 23:38:12 GMT  
 Dialog Based App Question
Hello,

To send a button click message, use this in the CDialog class

SendMessage(WM_COMMAND, MAKEWPARAM(IDC_BUTTON1, BN_CLICKED), (LPARAM)
GetDlgItem(IDC_BUTTON1)->GetSafeHwnd());

Hope this helps.

Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

|Newsgroups: microsoft.public.vc.mfc


|Subject: Re: Dialog Based App Question

|Thanks Douglas,
|
|But where do I get that message to post?
|
|I went looking for something in the Class Wizard and nothing looked
|familiar.
|
|Do you mean something like ON_BN_CICKED(id,memfxn) ?
|
|
|

|> In your OnInitDialog() function post the BN_CLICK message and let the
|> standard CDialog paint the dialog box, when it is done, you will get the
|> click message and all should work fine.
|>


|> > I have created the simplest Dialog Based App with Wizard.
|> >
|> > It has one control , a simple Button1 with it set to default.  I would
|> like
|> > to have the screen painted as normal and start executing code in the
|> > OnButton1() function.
|> >
|> > Everything I try, executes the OnButton1 code, but does not draw my
main
|> > dialog screen first.
|> >
|> > Hummmmm, I'm sure there will be other questions but for now, I'm
|stumped.
|> >
|> > Thanks,
|> >
|> > --
|> > Fritz Switzer

|> >
|> >
|>
|>
|
|
|



Tue, 21 Sep 2004 19:17:22 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Q: dialog-based app questions .

2. Dialog based app. question

3. Question on Dialog based app startup

4. Resizing a dialog based app based on its view's size

5. Modeless dialog in a dialog-based app

6. dialog within dialog based apps

7. Showing taskbar visible dialog from dialog based app

8. 2nd Dialog never appears in Dialog based app

9. Dialog-based app and modal dialog

10. HOWTO: hide dialog when a dialog-based app starts

11. dialog based app making modeless dialogs

12. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

 

 
Powered by phpBB® Forum Software