|
-
March 19th, 2012, 03:28 PM
#1
Newbie How do applications start?
I was given a project to make a flow chart of a windows application. I was given all the source files and the project file that opens with microsoft visual studio. There are about 30 header files and the MFC, which I know very very little about.
My question where does the flow start. All I know is the class, <<Cmainfrm>> has gui functions and functions that activate things when buttons are pressed. I also know that there is a function called create(). But what calls Cmainfrm? And what calls the create() function. How does c++ know to call these functions first?
-
March 19th, 2012, 03:36 PM
#2
Re: Newbie How do applications start?
-
March 20th, 2012, 03:40 PM
#3
Re: Newbie How do applications start?
Thank you.
I looked for instance declarations under the CWinApp class and couldn't find any.
I did find this though:
CWinThread *g_pBasThread=NULL;
Is my logic correct?:
So the initialization of this object invokes the constructors to create the GUI of the applet.
The GUI is looped forever.
The MFC message handler invokes functions when buttons are pressed on the GUI.
-
March 20th, 2012, 06:05 PM
#4
Re: Newbie How do applications start?
I looked for instance declarations under the CWinApp class and couldn't find any.
CWinApp class is typically inherited by your app class which instance must be declared in the global scope with the name theApp.
As well, a really good insight into MFC internals is the follwing article from Paul Dilascia:
Meandering Through the Maze of MFC Message and Command Routing
Best regards,
Igor
-
March 20th, 2012, 06:17 PM
#5
Re: Newbie How do applications start?
 Originally Posted by printz0r
... My question where does the flow start. ...
For another explanation, see "MFC under the hood" by Nish Sivakumar at http://www.codeproject.com/Articles/...under-the-hood
Basically, the MFC framework provides a hidden WinMain() function, which calls your implementation of CWinThread::InitInstance and then calls CWinThread::Run to run the message loop.
 Originally Posted by printz0r
Is my logic correct?:
So the initialization of this object invokes the constructors to create the GUI of the applet.
The GUI is looped forever.
The MFC message handler invokes functions when buttons are pressed on the GUI.
This is somewhat muddled thinking. All Windows applications need a WinMain() function. Do you have experience with plain-C programming for Windows?
Mike
-
March 22nd, 2012, 02:54 PM
#6
Re: Newbie How do applications start?
I'm being thrown in the deep end - There are multiple layers of the code, and I figured the flow chart shouldn't talk about how the MFC works, but more on how the functions work. The second disparity is the functions have their own layers =( which invokes other cpp files. The other cpp files actually communicate with class interface functions part of a .dll file for communicating between microcontrollers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|