TEAMtalk Beginner Notes 3---about win-client "second article: Entry file _ header file"

Source: Internet
Author: User
Tags teamtalk

To study the source code of an application, we often start with its first window: the login interface. At least I personally prefer to start the program from the moment, the first time to execute the function started.

Select the solution, right-click -Properties -To start the project, you can see that the single-boot project is currently selected:TEAMtalk. C + +The English name isCplusplus, abbreviated:CPP. This allows you to know that the entry file must be a file with the same name:Teamtalk.cpp, looking for something that can be found, such as location:

physical path of the file: \win-client\src\teamtalk\ folder below.

Since the entrance has been found, the next blog, we will simply analyze the entry file.

we know that every single. cppare accompanied by a. hheader file;the reason whyC + +The most important reason to use the header file isC + +the same project may have multiple source code files , it is fatal that these source code is separately compiled separately. In other words, when compiling one of these files, the compiler does not know what is defined in other files, such as classes, global variables, and so on. This requires that we declare it in every file where we want to use a class, function, or variable, otherwiseC + +is unable to find it.

So, let's talk first. teamtalk.h The contents of this header file:

First, #pragma once // compile only once

Compiler precompiled commands: Compile only once, use: often appear in header files. Because the same file is referenced more than once in many source files. If no compilation is specified, a redefinition error occurs at compile time.

Same function command:
#ifndef Abc_h
#define Abc_h
header file code content *******
#endif

Second, #ifndef __afxwin_h__

#error " include stdafx.h" before including this file to generate the PCH file "

#endif

#ifndef is a macro definition, it is possible to select a branch based on whether a variable has already been defined.

#error command is C + + one of the preprocessing commands of the language, when the preprocessor is preprocessed to #error command stops compiling and outputting user-defined error messages.

Three, it is not difficult to understand that the first to load stdafx.h This header file (standard system contains files containing files, frequently used but infrequently changed, or project-specific include files)

There is a small detail worth mentioning, generally #include "" the inside are all custom header files, and #include <> The inside of the header file is inside the system disk for example: #include <afxwin.h> .

Iv. other annotations such as:

About the Teamtalk-client entrance file header file is here, and then go to get an ABAP report to go ...

TEAMtalk Beginner Notes 3---about win-client "second article: Entry file _ header file"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.