MFC Dialog based Application w/no buttons? 
Author Message
 MFC Dialog based Application w/no buttons?

Hello,

I need to write an MFC Dialog-based application that has no buttons, but
determines what it needs to do from command line parameters, and then
displays some things in a textbox.  After it's done, it should just
exit.

Some questions:

1) Using AppWizard, how do I create such an application?  Can I just
create the Dialog application using the wizard, then simply delete the
OK and Cancel buttons?

2) As far as the code that I need to implement to evaluate the command
line parameters and then perform the work (some calculations and then
display), where's the "right" place to put this code, especially since I
won't have any "Onbutton..." functions, etc.?

Should I put it in OnInitInstance?

My apologies if these are somewhat unusual questions...

Jim



Fri, 05 Nov 2004 13:10:39 GMT  
 MFC Dialog based Application w/no buttons?

Quote:
>I need to write an MFC Dialog-based application that has no buttons, but
>determines what it needs to do from command line parameters, and then
>displays some things in a textbox.  After it's done, it should just
>exit.

>1) Using AppWizard, how do I create such an application?  Can I just
>create the Dialog application using the wizard, then simply delete the
>OK and Cancel buttons?

Jim,

That seems reasonable to me.

Quote:
>2) As far as the code that I need to implement to evaluate the command
>line parameters and then perform the work (some calculations and then
>display), where's the "right" place to put this code, especially since I
>won't have any "Onbutton..." functions, etc.?

>Should I put it in OnInitInstance?

You need to put the code to create the controls in OnInitDialog.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Fri, 05 Nov 2004 14:49:01 GMT  
 MFC Dialog based Application w/no buttons?
Read my essay on creating dialog-based apps on my MVP Tips site.

I would simply do a GetCommandLine() [I think that's the API; I haven't used a command
line in years] in the OnInitDialog handler. OnInitInstance is far too soon, since the
dialog has not yet been created until the DoModal(), and after the DoModal() returns it is
too late.
                                joe

Quote:

>Hello,

>I need to write an MFC Dialog-based application that has no buttons, but
>determines what it needs to do from command line parameters, and then
>displays some things in a textbox.  After it's done, it should just
>exit.

>Some questions:

>1) Using AppWizard, how do I create such an application?  Can I just
>create the Dialog application using the wizard, then simply delete the
>OK and Cancel buttons?

>2) As far as the code that I need to implement to evaluate the command
>line parameters and then perform the work (some calculations and then
>display), where's the "right" place to put this code, especially since I
>won't have any "Onbutton..." functions, etc.?

>Should I put it in OnInitInstance?

>My apologies if these are somewhat unusual questions...

>Jim

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Sat, 06 Nov 2004 01:56:47 GMT  
 MFC Dialog based Application w/no buttons?

Quote:

>I need to write an MFC Dialog-based application that has no buttons, but
>determines what it needs to do from command line parameters, and then
>displays some things in a textbox.  After it's done, it should just
>exit.

What makes it exit ?  Is this on a timer ?  How do you know the user
has actually read what it's just displayed ?

--
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Sat, 06 Nov 2004 03:28:56 GMT  
 MFC Dialog based Application w/no buttons?
Bob,

Yes - the exit is determined via a timer, which is somewhat determined
by the command line parameter...

Quote:


> >I need to write an MFC Dialog-based application that has no buttons, but
> >determines what it needs to do from command line parameters, and then
> >displays some things in a textbox.  After it's done, it should just
> >exit.

> What makes it exit ?  Is this on a timer ?  How do you know the user
> has actually read what it's just displayed ?

> --
> Bob Moore [WinSDK MVP]
> http://www.mooremvp.freeserve.co.uk/
> (this is a non-commercial site and does not accept advertising)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Do not reply via email unless specifically requested to do so.
> Unsolicited email is NOT welcome and will go unanswered.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Sat, 06 Nov 2004 21:51:10 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to enable/disable Toolbar button in Dialog Based MFC application

2. cannot gray toolbar-buttons in an mfc-dialog-based application

3. Adding Another MFC Dialog to the Dialog base application

4. How to not show task button with a base dialog application

5. How not show task button with a base dialog application

6. Dialog based MFC application problem

7. dynamic drawing with dialog based MFC application

8. MFC dialog based application exit code

9. in MFC dialog based application call Win32 Dll fail

10. dialog based MFC app. application file types

11. Drawing frame on a Dialog based MFC application

12. MFC dialog based application link error under _UNICODE

 

 
Powered by phpBB® Forum Software