One of the API starter Series-that ' annoying ' windows data type

Source: Internet
Author: User
Tags definition header

Hello Everybody This is Beyondcode

Hello, everyone. I am beyondcode, this whim, planning to do a series of Windows API programming tutorial, used to help some of the Windows API programming confused, puzzled, confused novice friends.

Let's explain some terms or nouns first.

The SDK is a shorthand for software Development kit, meaning the software development package, which contains some of the header files, libraries, tools, and help documents that we use to write programs.

Windows API programming refers to the interface functions that invoke windows to write programs, such as MessageBox is an API function or interface function. How to say all can, oneself understand on the line. If you don't understand this, I don't think I'll be able to find this article. ~

Why do this series of tutorials, please listen to me one by one, first, recently met some things some people let me really feel in this aspect of the introductory article is really scarce, plus the Windows SDK header files in the complex, large, ' annoying ' macro definition and data type definition, for a novice ( I am talking about the novice is not only just contact programming, but also in other languages have a relatively high attainments of friends, a pure SDK written HelloWorld program is a difficult and challenging task. In the spirit of helping others, happy their own principles, I have this intention, of course, I have learned before, experience to do a memory, is also part of this plan.

To make a statement, this series of tutorials for the vast number of first Contact WIN32 SDK program to write the novice friends, if you are a master, a laugh and over it ~ Of course, in addition to a smile, but also thank you for your mistakes in the article, lest I fraught AH ~ ~ Thank you

Ok nonsense not much to say, to get to the point, the first article today, what to say? For a newcomer, the first contact with SDK programming or API programming, what puzzles you the most, we talk about it, I think that ' annoying ' data type definition and macro definition in the Windows SDK should be the role of this.

In fact, Microsoft's intentions are also good, in order to reduce the burden on programmers, and for programming convenience, it took so much thought and energy to define such a large set of data types and macro definitions, which is why I said before that it is annoying is the reason to enclose quotes, because he is not really annoying, skilled, you not only don't feel it annoying, But can not live without it, hehe, the day long affectionate that is so come.

Let's look at some data type definitions first

typedef float FLOAT;

typedef long Long;

typedef short Short

typedef int INT;

typedef char CHAR;

Float, long, short, int, char these data types are all familiar with the data types of C + +, Microsoft has redefined them, it is very simple, is to change the name of the capital, the purpose of this is probably Microsoft for coding convenience, Input method is not necessary to change the size of the case, more humane ah ha ...

Look at several examples of data type definitions

typedef unsigned int UINT;

typedef unsigned int UINT32;

typedef signed INT INT32;

typedef unsigned long DWORD;

typedef unsigned short WORD;

The definition of these data types has a little bit of a substantial effect, pay attention to observation, they are relatively short, do not have to write so long, but also more intuitive, if I want to define an unsigned shaping, I do not have to write unsigned int A;

So long, just uint A; How simple, more clear, so I said it is not annoying.

Among them is the SDK program can often see a data type, often used, many novice also do not understand, this is what data types Ah, now see it, in fact, is an unsigned long plastic surgery unsigned long, gave him a nickname just · There is no technical content, so don't be afraid, the program is to write unsigned long or a DWORD to see your own mood, because they all represent the same data type.

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.