Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1997-11-30
2
Medium Priority
?
517 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 40 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

971 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