1. The default parameter cannot be used for C functions.
2. How does VC view the error message (getlasterror () in the debugging status ())
Generally, you can use getlasterror () to get the error number and then use formatmessage (...) to get the error description.
Here is a more direct method: Add @ err, HR in the watch window
3. Compile Win32 applications in VC without relying on the msvc Runtime Library: ensure that the application (exe) and Libraries (Lib, DLL, etc.) included in the application) all are compiled under MTD (Debug) or MT (release. How to Set in VC: Project-> properties-> Configuration properties-> C/C ++-> code generation-> Runtime Library-> multithreading (/MTD) (Under Debug) or multiple threads (/mt) (Under release ).
4. In VC attribute settings, choose Project> Properties> Configuration Properties> linker> display progress> display certain progress messages (/verbose: Lib ), in this way, you can see the link sequence in the output window during the compilation of the link program, which is helpful for handling errors reported by some duplicate libraries.
5. Repeated definitions in Win32 network programming. For example:
Error c2011: "fd_set": "struct" type redefinition
Error c2011: "timeval": "struct" type redefinition
This is because the header file is contained multiple times,
By default, windows. H will contain Winsock. H. When you include winsock2.h, it will conflict. Therefore, you need to define a macro before including windows. h to remove Winsock. h.
Add the following code:
# Define win32_lean_and_mean
# Include <windows. h>
6. inline functions: these functions are replaced by the memory space in exchange for execution time. They can be used to write inline functions for some frequently-needed functions (such as tool functions) to speed up calling. Considerations for inline functions: loop statements and switch statements are not allowed. inline functions must contain the function body to define inline functions.