Solved

Visual C++ 5.0 Program Structure Vs Regular C Program Structure

Posted on 1997-11-30
2
496 Views
Last Modified: 2010-05-18
I am learning windows based programming and I am having a hard time following the code on what is going on.  I have been programming in C for a bit and understand what is happening there.  For Example

#include <files here>

int main() {   //program begins
  declare variables
  call functions
  end program
}

very easy to understand.  However, in visual c++ it is a bit more elusive for me to follow.

Can someone just basically go through how it starts, creates window, handles some type of input and exits?  I am not looking for code, but just some kind of flow in more detail then above.

Thanks
Darrell


0
Comment
Question by:larockd
2 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1174447
Are you using MFC? Are you using MFC AppWizard to create your program?
0
 
LVL 7

Accepted Solution

by:
galkin earned 20 total points
ID: 1174448
Windows application is based on message loop proccessing messages( notification that something hase happened).When you create windows application you create at least one window and define special function called window procedure callback function to be called every time some message needs processing. Each message is defined by unique ID and has two parameters through which extra data can be passed, This message loop roots data when special message is sent to the window indicating you should exit message loop, close window and appplication is terminated. This equivalent to defineing while loop in main C procedure and when condition of while statement becomes false( equivalent to window receiving close message) you exit while loop and main returns.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now