Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDialog windows -- where does the application code go Pin
Dave Sweetser16-Nov-03 16:35
Dave Sweetser16-Nov-03 16:35 
GeneralRe: Dialog windows -- where does the application code go Pin
Prakash Nadar16-Nov-03 16:58
Prakash Nadar16-Nov-03 16:58 
GeneralRe: Dialog windows -- where does the application code go Pin
Dave Sweetser16-Nov-03 17:18
Dave Sweetser16-Nov-03 17:18 
GeneralRe: Dialog windows -- where does the application code go Pin
Prakash Nadar16-Nov-03 17:30
Prakash Nadar16-Nov-03 17:30 
GeneralRe: Dialog windows -- where does the application code go Pin
PJ Arends16-Nov-03 19:06
professionalPJ Arends16-Nov-03 19:06 
GeneralRe: Dialog windows -- where does the application code go Pin
David Crow17-Nov-03 4:38
David Crow17-Nov-03 4:38 
GeneralRe: Dialog windows -- where does the application code go Pin
Mike Danberg17-Nov-03 10:20
Mike Danberg17-Nov-03 10:20 
GeneralRe: Dialog windows -- where does the application code go Pin
Mike Danberg17-Nov-03 11:43
Mike Danberg17-Nov-03 11:43 
Decided to continue my post since I didn't really mention what you were asking.

Anyway I recommend that first you start out by making a simple Dialog based MFC app using the wizard. I think this is the easiest thing to understand and its what I started out learning. You can immediately run the program and it will show you the default dialog that was created. Open up the file projectnameDlg.cpp (projectname is what you called the project). This is where you will be adding code. In a dialog window all the code that handles things displayed to the screen generally is done within the dialog's class. It can be done outside of it, but that's more advanced so I won't get into it.

Some main places that your code can go is in OnInitDialog() and in functions for each control. Its kinda hard to tell you how to do things here, so the only thing I can really tell you without walking you through an example, is to double click on the OK button in the resource and it will generate the function for when the button is clicked. This is an example of where you'd put code that you want to execute when the button is pressed.

Now for what you want to do, you'd be choosing an SDI application. To me an SDI makes more sense if you understand dialog based although many people will say its the other way around.

The way an SDI works is you paint things onto the screen. This is done in the ChildView using the OnPaint() function. That's where you can put code in order to draw things. Generally you won't be doing the drawing directly from OnPaint, but rather you'll be calling other functions you create to do something and then draw things from there. But for a simple example just to learn you can draw a circle directly in the OnPaint() function.

Hope this helps. Anyway like I said in my previous post I'm more than willing to walk through some examples with you. Helps me sharpen me skills Smile | :) .

Mike
General.NET issue Pin
kjessee16-Nov-03 15:32
kjessee16-Nov-03 15:32 
GeneralRe: .NET issue Pin
Christian Graus16-Nov-03 16:12
protectorChristian Graus16-Nov-03 16:12 
GeneralRe: .NET issue Pin
kjessee16-Nov-03 16:20
kjessee16-Nov-03 16:20 
GeneralRe: .NET issue Pin
Christian Graus16-Nov-03 16:28
protectorChristian Graus16-Nov-03 16:28 
GeneralRe: .NET issue Pin
Prakash Nadar16-Nov-03 17:24
Prakash Nadar16-Nov-03 17:24 
GeneralRe: .NET issue Pin
kjessee16-Nov-03 21:55
kjessee16-Nov-03 21:55 
Questionwhere's main() ??? Pin
Dave Sweetser16-Nov-03 14:10
Dave Sweetser16-Nov-03 14:10 
AnswerRe: where's main() ??? Pin
Ravi Bhavnani16-Nov-03 14:22
professionalRavi Bhavnani16-Nov-03 14:22 
GeneralRe: where's main() ??? Pin
Dave Sweetser16-Nov-03 14:34
Dave Sweetser16-Nov-03 14:34 
GeneralRe: where's main() ??? Pin
Ravi Bhavnani16-Nov-03 15:00
professionalRavi Bhavnani16-Nov-03 15:00 
GeneralRe: where's main() ??? Pin
Dave Sweetser16-Nov-03 15:22
Dave Sweetser16-Nov-03 15:22 
GeneralRe: where's main() ??? Pin
Ravi Bhavnani16-Nov-03 15:37
professionalRavi Bhavnani16-Nov-03 15:37 
GeneralRe: where's main() ??? Pin
Dave Sweetser16-Nov-03 15:57
Dave Sweetser16-Nov-03 15:57 
GeneralRe: where's main() ??? Pin
Johnny ²16-Nov-03 21:43
Johnny ²16-Nov-03 21:43 
GeneralRe: where's main() ??? Pin
Ravi Bhavnani17-Nov-03 3:43
professionalRavi Bhavnani17-Nov-03 3:43 
GeneralI need some help please Pin
Anonymous16-Nov-03 13:18
Anonymous16-Nov-03 13:18 
GeneralRe: I need some help please Pin
Christian Graus16-Nov-03 16:16
protectorChristian Graus16-Nov-03 16:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.