GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 12-Jul-2004, 15:21
Pandiani Pandiani is offline
New Member
 
Join Date: May 2004
Location: The Balkans
Posts: 16
Pandiani is on a distinguished road

daialog based application MFC


I've just made my first dialog application using MFC. It is interesting that there is no main() or WinMain() function.
I have programmed in C++ for a while, but not Visual C++ and windows applications.

What is substituion for main() finction and how this work?

What is the purpose of BEGIN_MESSAGE_MAP?
Maybe this is substituion for main() or ...?
  #2  
Old 28-Jul-2004, 10:06
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 960
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Thumbs up

You will see something like this in your application_nameDlg.cpp file:

BOOL Capplication_nameDlg::OnInitDialog(){
//code

// TODO: Add extra initialization here
}

This is "kind of a main" (not really). It is the first thing that your program executes when you run it.
Add your initialisation where it says.
The rest is done with messages - hence the MESSAGE_MAPs. You can add code in order to tell your application what to do when , let's say, a button is pressed and so on.
It's quite easy if you use Class Wizard and you don't really ( ) need to know about the MESSAGE_MAP macros you see - CW will add them 4 u.
I suggest u get yourself something like TYVC++ in n days , and you are ready to start.

Good luck!
Luci
  #3  
Old 01-Aug-2004, 11:45
Max Payne's Avatar
Max Payne Max Payne is offline
Regular Member
 
Join Date: Apr 2004
Location: 3° 08 North 101° 42 East
Posts: 332
Max Payne is a jewel in the roughMax Payne is a jewel in the roughMax Payne is a jewel in the rough
I don't actually know what is the main in MFC, maybe the YourDlgApp class. Thats where everything starts. OnInitDialog is where the dialog class starts...

like luciwiz said, MESSAGE_MAPs is where the messages for your dialog is being processed. yep, classwizard would most of the work for you, but still you need to know it.. there are some messages that classwizrd don't know..

for example, the advanced message such as UPDATE_COMMANDUI,UPDATECOMMANDUI_RANGE could not be done with classwizard.. so you still need to know it.
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds
 
 

Recent GIDBlogUS Elections and the ?Voter?s Responsibility? by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The specified CGI application misbehaved by not returning a complete set of HTTP head bacchus MySQL / PHP Forum 6 16-Jul-2007 22:12
connecting web based dbserver to vc++ appln meeranat Apache Web Server Forum 0 07-Jun-2004 06:03
Console to MFC application vadharah MS Visual C++ / MFC Forum 6 12-May-2004 01:30
web server in secure mode not connecting to http application tcsasp Apache Web Server Forum 0 06-Nov-2003 01:08
GeoURL ICBM Address Server aka where is your site based and compare it to others jrobbio Advertising & Affiliates Forum 0 04-Apr-2003 15:28

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:44.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.