Author: XGM RRC.BIT record in 2001-8-10 Gong Jianwei comment: This study notes, though not systematic exposition of a problem, but to read people feel learned a lot, whether you are a novice or old bird, I will agree . I hope that XGM will continue to write down, watching "in-depth shallow MFC" to see these notes, and there is also the "deep-depth shallow MFC" of the new feelings, "in-depth shallow MFC" is a good book, I have a certain C basics and a little on VC. Perceptive VC beginners who know know them come into contact with this book. It should be said that this book is not really suitable for beginners like me, but read the book, there are still some gains, only part of the part, as a learning note. 1. Install VC , why should I install Internet Explorer? (Is many old birds don't know, Mr. Hou Junjie is to know, but also to know the same, 5555555555 ............) Because Microsoft's Visual Tools (including Visual C , Visual Basic, Visual FoxPro, Visual J , Visual InterDev, etc. are centralized by so-called Visual Studio management, and these tools have a great goal, which is to help develop Internet applications, so they hope to be with IE. 2. SDK: Software Development Kit originally referred to software development tool, but now there is a proprietary noun, and the program written by Windows RAW API is often referred to as an SDK program. Some people also call the Windows API as the SDK API. 3. Construction function of different types of objects (the first execution of the object after birth and the function of automatically execute) and the destructive function (the object line will be destroyed, but the time before, but not destroyed, the final implementation and automatically execute functions) execution timing comparison as follows:
The global object local object static object When the object constructor constructor generated by the NEW is executed (earlier than the program entry point earlier), the execution program process will execute the execution program to execute the program process to leave the object. Performed at the end, but the destructor than the global object is taken. Objects are executed by DELETE 4. C is not a purebred object-oriented language (SMALLTALK and JAVA are only).
Therefore, there is a global function that does not belong to any class, and they all start in the function name, and I don't mean. It is just to make a loud name, AF, Application Framework, is common Afx global function: AfxBeginThread: start a new thread AfxEndThread: the end of an old thread AfxFormatString1: printf-like format string generally AfxFormatString2: printf-like format string generally AfxMessageBox: similar to the Windows API function MessageBoxAfxOuputDebugString: character String to the decentralizable device AFXGETAPP: Get an Application Object (CWINAPP derived object) pointer AFXGETMAINWND: Get the program main window Pointer AFXGETITISTANCE: Get the program's Instance Handle 5. MFC Data Type The following is the data type BOOL common to Win32 program : Boolean value, value for true or falsebstr: 32-bit character pointer BYTE: 8-bit integer, no positive or negative colorRef: 32-bit value, representing a color value DWORD: 32-bit integer No. Long: 32-bit integer, with positive negative LPARAM: 32-bit integer, a parameter lpcstr: 32-bit pointer to a window function or a callback function, pointing to a constant string LPSTR: 32-bit pointer, pointing to a character String LPCTSTR: 32-bit pointer, pointing to a constant string, this string can be ported to the Unicode and DBCSLPTSTR: 32-bit pointer, pointing to a string, this string can be ported to the Unicode and dbcslpvoid: 32-bit pointer, pointing A data LPRESULT: 32-bit value, a return value of a window function or a Callback function, is a 16-bit unpigneous number integer in Win16, and a 32-bit unpredictable in Win32. Negative number, WNDPROC: 32-bit pointer, pointing to a window function word: 16-bit integer, unpaired wPARAM: window function or a parameter of the callback function, 16-bit in Win16, in Win32 32-bit below these is the unique data type of MFC Position: a value, representing Collection Objects (such as array or linked list) are often used in MFC Collection classes (ie data processing classes, such as carray) LPCRect: 32-bit pointers, pointing to a constant RECT structure 6. Strange window name AFX: B : 14AE: 6: 3E8F When viewing the name of the window class with SPY (a tool attached to VC ), the window class name will be discovered to become like AFX: B: 14AE: 6: 3E8F this strange look? It turned out that Application Framework converted the name of the window class to AFX :: x: Y:
Z: W The type of window is the name of the window: X: Window style HEX value Y: window mouse cursor HEX value z: window background color HEX value W: window icon's HEX value 7. Serializable necessary conditions for SERIALIZABLE An object has Serializable capabilities, which must be derived from a Serializable class, a class to be serializable, must have the following five conditions: (1) Delicate from COBJECT, so that RTTI, dynamic generation, etc., etc., can be maintained (2) class The declaration section must have a declare_serial macro, this macro requires a parameter: Class Name (3) class must have an IMPLEMENT_SERIAL macro, this macro requires three parameters: First, the class name, the second is the base class name, the third is SCHEMA NO. (4) Remove the Serialize virtual function to appropriately write the member variables of the class (5) to this class with a default constructor (not the parameter), this condition is often a person Ignore, but it is necessary, because if an object is from the file, the MFC must first dynamically generate it, and the constructor is called without any parameters, and then the object data is read from the file. Hey, good stuff is too much, such as the simulation of the six key technologies of MFC, the interior of the three major macros, etc. (咦, I am not selling this book, huh, huh, huh), please see this This book, you can find me, the so-called "book is not borrowed." Ha ha………