-Wince programming (3rd edition)-1.2 is still Windows Programming

Source: Internet
Author: User

Windows Programming
Although there are indeed differences between Windows CE and other versions of Windows, it should not be exaggerated. Compile a Windows CE ApplicationProgramWrite Windows applications.

There are the same message loops, the same windows, and in most cases, the same resources and controls. The difference does not cover up the same place. The Hungarian naming method is one of the important similarities.

Hungarian naming method
Since Charles Petzold wrote the book windows programming, most Windows programs have adopted the Hungarian naming method, which is a traditional and good naming method. This programming style was invented by Charles Simonyi many years ago at Microsoft. It represents the type of a variable with a prefix of 1 to 2 letters for each variable in the program. For example, the string array named name should be named szname, And the prefix SZ indicates that the variable type is a string with 0 Terminator. The value of the Hungarian naming method is that it greatly improves the readability of the source program. For other programmers Code You should not repeat the variable declaration to determine the type of the variable. Table 1-1 lists the typical Hungarian prefixes of variables.
Table 1-1 variable's Hungarian prefix
Variable type Hungary prefix
Integer I or N
Word (16-bit) W or S
Double Word (32-bit unsigned) DW
Long (32-Bit Signed) L
Char C
String SZ
Pointer P
Long pointer lp
Handle H
Window handle hwnd
Struct size CB

You can see some traces of early windows. LP or long pointer. In INTEL 16-bit programming mode, the pointer is divided into two short pointers (16-bit offset) and long pointers (additional offset segments ). Other prefixes consist of abbreviations of types. For example, the brush handle is usually HBR. A prefix can be a combination, just like lpsz, which indicates a long pointer ending with 0. Most windows APIs use Hungary notation to name their domains. This naming method is used throughout this book. I encourage you to use this naming method in your program.

Related Article

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.