Some easier places in VC

xiaoxiao2021-03-06  46

Source: Author - VCMFC) 1. False / True and false / true Difference: false / true is a new keyword in the standard C language, and false / true is #define, this is the purpose of the solution is The difference in the environment in C and C , the following is false / true definition: #ifndef false # define false 0 # endif # ifndef true # define true 1 # Endif That is, false / true is int type, and false / True is a Bool type; so the two are different, but we don't have this feeling in use, because C will help you do implicit conversions. 2. The difference between Bool and Bool: Bool is 1 byte in C , and Bool is int type, the Int type is determined by the specific environment; so say: false / true only 1 word In terms of the specific environment, True / False is the definition of Bool in WINDEF.H: TypeDef Int Bool; 3. Null and 0 Difference: Or let us look at the definition of NULL in WINDEF.H: #1fNDef Null # ifdef __cplusplus // This is indicating that the program is compiled with C # define null 0 # Else # define null ((void *) 0) # Endif # Endif So say: They don't have the difference, just in C will be a Mandatory type conversion.

4. The difference between Hinstance and HModule: Definition in WINDEF.H: typedef hinstance hmodule; / * hModules can be used in place of hinstances * / 5.callback, WinAPI essence: In WINDEF.H, definition: #undef Far # undef near # undef Pascal # define far # define near # i (! defined (_MAC)) && ((_msc_ver> = 800) || defined (_stdcall_supported) # define pascal __stdcall # Else # f defined (dOSWIN32) || defined (_MAC) #define cdecl _cdecl # ifndef cDECL # define cDECL _cdecl # endif # else # define cdecl # ifndef cDECL # define cDECL # endif # endif # ifdef _MAC # define CALLBACK PASCAL # define WINAPI cDECL # define WINAPIV CDECL # define APIENTRY WINAPI # define APIPRIVATE CDECL # ifdef _68K_ # define PASCAL __pascal # else # define PASCAL # endif # elif (_MSC_VER> = 800) || defined (_STDCALL_SUPPORTED) #define CALLBACK __stdcall # define WINAPI __stdcall # define WINAPIV __cdecl # define APIENTRY WINAPI # define APIPRIVATE __stdcall # define PASCAL __stdcall # else # define CALLBACK # define WINAPI # define WINAPIV # define APIENTRY WINAPI # define APIPRIVATE # define PASCAL pascal # endif6 some common types are defined: in the wind In the definition ef.h: typedef UINT WPARAM; typedef LONG LPARAM; typedef LONG LRESULT; typedef int INT; typedef unsigned int UINT; typedef unsigned long DWORD; typedef int BOOL; typedef unsigned char BYTE; typedef unsigned short WORD; typedef float FLOAT ; typedef unsigned long ULONG; typedef unsigned short USHORT; typedef unsigned char UCHAR; typedef char * PSZ; 7 common type of resource Window essence: the definition windef.h:. DECLARE_HANDLE (HPEN); DECLARE_HANDLE (HBITMAP); DECLARE_HANDLE ( HBRUSH); DECLARE_HANDLE (HDC); DECLARE_HANDLE (HFONT); DECLARE_HANDLE (HICON); DECLARE_HANDLE (HMENU); DECLARE_HANDLE (HMETAFILE); DECLARE_HANDLE (HINSTANCE); DECLARE_HANDLE (HPALETTE); typedef WORD ATOM; typedef HANDLE HGLOBAL; typedef HANDLE HLOCAL; Typedef Handle Globalhandle;

转载请注明原文地址:https://www.9cbs.com/read-79567.html

New Post(0)