Solved

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

Posted on 1997-11-30
2
498 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

910 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

19 Experts available now in Live!

Get 1:1 Help Now