Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I guess my last question was a little too vague. I can write in C/C++/COBOL/HTML/VB/FORTRAN and I dabble in a few others. I just need some help learning the Windows way of programming. Almost anyone can create an MFC project using MS Visual Studio 2010, but I'm having trouble wrapping my head around it. I searched the Internet and forum after forum for answers, but still empty headed. If some good hearted person(s) would show me the next steps after creating an SDI project for creating a simple phonebook program. I can write the program in C++/CLI, but I have NO idea how to incorporate this into a windows program. I would ALMOST pay someone a million dollars to show me how to do this. PLEASE and THANK YOU!
Posted

1 solution

This is a really broad question... but here's the gist of it.

Well, MFC is an object oriented framework that wraps around the WinAPI. Essentially it does a few things auto-magically for you, the most essential parts being registering as a process with Windows upon startup and creates an entry point (which you can do without MFC as well). If you tell VS2010 that you want to build an MFC app, it'll create a baseline for you derived from CWinApp (which contains InitDialog(), where you start everything related to your app), an MFC class that does a bunch of initialization for you plus creates a message pump so that you can message to/from the app. From there, it sort of branches depending on what type of app it is. The simplest is probably the dialog based application. It consists of a CWinApp and a dialog typically derived from CDialog(). The dialog class is meant to enclose all GUI related controls. If you're going to build your first MFC app, I'd recommend starting with a dialog application.

[edit]
...You can use the wizard to help you start off with a dialog but make sure you understand the code that it put in for you, in the long run, that'll make your life way easier. After a while you can do everything by hand (which is what you want to end up doing anyway if you're going to do extensive development that you can support).
[/edit]

[edit2]
And before it gets misinterpreted, MFC is a FRAMEWORK, not necessarily just a wrapper on WinAPI. So it provides a baseline for building applications much like Qt or other frameworks would.
[/edit2]
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 1-Jun-11 21:15pm    
Now, you can demand a million. Or almost :-) For now, I vote my 5.
--SA
Albert Holguin 1-Jun-11 21:52pm    
I won't hold my breath... :D
[no name] 1-Jun-11 23:51pm    
Hey albert can you have any idea of Tool tip crash!
Albert Holguin 2-Jun-11 0:00am    
let me look at that post again... don't recall details
Albert Holguin 2-Jun-11 0:06am    
oh... i remember that post now... all I can say is that there's a problem with some invalid pointer...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900