Visual Studio uses tips (take vs2012 as an example)

Source: Internet
Author: User

1.VS drag variables into memory to view the reason for the failure: it is only useful to drag the address into memory to add & drag before the monitored variable

2.VS change the alignment of struct Members: C + +---> code generation---> Struct Member Alignment, default 8-byte alignment

4. Turn off vs array out of bounds check: C + +----> code generation-----> Security Check

5.VS How to drag variables directly into memory value: Select variables to drag into the memory window

6. Close vs Security function Check, project Properties->c/c++-> preprocessor---preprocessor definition Join macro _crt_secure_no_warnings

7.VS go to function definition: F12

8.VS exit Overtype mode: Press the INSERT key

9.VS off code optimization: Engineering right-to-C + +--and optimization

10.VS Defining code blocks:

#pragma region XXX

#pragma endregion
In the middle of two sentences to write code, in front of the first sentence there will be a plus, click to collapse and expand the code

11.VS generated EXE to run on a machine that does not have a VS installed, it needs to be changed in the project properties: General-->MFC Usage--Configuration type--static MFC

12.VS Auto Window function: Can see the function return value in real time

13.VS Real-time view function error: Add ERR,HR in Watch (note is comma)

VS Change Program Entry point: Connector-all options-and entry points, you can change the entry point of the program to a non-main function

Add a fixed header file to the VS2012. The application space is not released, and at the end of the program, the Debug window alerts

Header File Method:
Add the following code to the ① header file
#ifdef _DEBUG
#define Debug_clientblock New (_client_block, __file__, __line__)
#else
#define Debug_clientblock
#endif
#define _crtdbg_map_alloc
#include <stdlib.h>
#include <crtdbg.h>
#ifdef _DEBUG
#define NEW Debug_clientblock
#endif
② is added in the main function
_CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);


+ vs off Random base addresses: linker--advanced--random base

+ vs Off Data Execution Prevention (DEP): Linker--advanced--Data Execution Prevention (DEP)

18. Copy vs Inside Disassembly code data: Hold ALT + Drag to create a rectangle box, the data in the box will be copied

VS Display line number: All languages, text Editor, tools, options

VS Open Class Wizard: Ctrl + SHIFT + X

The VS Call Stack window action can see the function call relationship Alt+f7

V. VS Open Memory Window Alt+f6

Not finished:

Visual Studio uses tips (take vs2012 as an example)

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.