VC ++. Net integration development environmental use skills

zhaozj2021-02-08  506

I have to apologize first. Recently, the company project is going to pay, the construction period is rushing, there is no way to internet online, please forgive me. This time has nothing to put. It's so faster. Faster New Year's Day, today's value of Christmas, make a relaxed content, let everyone appreciate the eye is the right way! In the following, I will describe the various skills of the VC.Net2003 in the form of an entry. You can choose the memory you are interested in, and you don't even look at it, just ask you some support, UP will Ok, it's an encouragement to me!

First of all, I use these techniques in the environment of VC.Net2003, of course, I hope you can have a set. Of course, not to say that VC6 can't use it, just some features can't be used, and you need you to try it!

I. Environmental Settings section 1. Each sub-window in the main window can be dock, Dock's sub-window on the side has two twists in the upper right corner, one is closed, one is a pushpin. When the push is pressed, the child window will not automatically retract back to the edge, and it can be pulled out by the header bar of the drag window. I recommend all unwanted sub-windows, and then turn off all the docks to the bottom and the left, and the required subfamies are all put on the right, then pull the icon, when you want to see If the mouse is moved, you can see it. When you slide out, you will not block the code, and leave the biggest space for the code editing.

2. The toolbar also has a Dock property similar to the sub-window. Turn off the toolbar, you can drag it out and close it. Each of the toolbars and menus can be set, the method is right-click on the toolbar or menu bar, then point it to the pop-up menu point, then you can drag on the toolbar and menu bar, very Easy to complete the custom department. You can also select one of the right click to set the detailed properties of this. I recommend turning off all the tools, because the general usual command has a shortcut key, and uses the menu that is not commonly used, so that you can save your code to code.

3. The shortcut key settings for the keyboard can be set in the Tools Menu -> Options -> Environment -> Keyboard. There are some preset keyboard mappings, you can choose one of them, and then save themselves as your own solution after you will modify it. I strongly recommend the use of Visual C 6.0 keyboard map, very happy!

4. In Tools Menu -> Options -> Environment -> fonts and colors can set fonts and colors in the code editing. Here you can call the font because the default 9 word is too small, it is unclear. My setting is No. 11 young circle. For detailed settings of font color, you can use the back of the color to select the color you like, I still like the colorful look of the whole code!

First, the code editing section 1. If the indentation of a piece of code is very messy, space, Tab is a big pile of messy, then this section is selected, in Editing Menu -> Advanced Press to format the selected content. This code is automatically organized. If the space and Tab are used in a piece of code, the format seems to be neat, you can go to the Edit menu -> Advanced -> View blank, check the space and TAB in the code.

2. In the Tools Menu -> Options -> Text Editor -> C / C -> The launch clicked in the URL positioning, this item is not used in the C / C code editing, but it will cause some misunderstandings. Take the line number, I think this is a small space, but it is very convenient. Tuning the character size and indentation size in the text editor -> C / C -> Table characters are 4, which helps to compile neat code. If you open the line number, it is recommended to turn off the margins of the selected content in the text editor -> normal, because this is a bit more. 3. Set the path to the project file in the Tool Menu -> Options -> Project -> VC directory. The general setting contains files and library files.

4. There are two drop-down list boxes on the code compilation window. The left is the visible domain. Use this function to greatly improve programming efficiency.

5. Outline shows a very good feature, but many people may not be used to. Can be displayed in Editing -> Outline Show -> Stop Outline Shows Turn off it. If you want to enable the outline display when you want to start, you can go to the outline mode when you open the file in the Tool Menu -> Options -> C / C -> format setting.

6. Select a piece of code and press TAB to increase its indentation; hold the ALT to stand a code; the mouse is placed on the line number bar or the code left distance (if you enable) will become a pointer to the opposite direction. At this time, you can select the corresponding line; select the code, you can drag the selected code to the appropriate position; press and hold the Ctrl and press the left and right direction keys to move the cursor and skip the keyword; Ctrl Home and Ctrl End are arrived Document top and bottom; contact Shift and then press the direction button to select the character skilled in the crate, can be used with Ctrl; Ctrl A can be selected; Ctrl = and Ctrl - can return to the location of the code you just viewed; You can use parentheses matching functions to help write complete code, brackets when parentheses match, this can be set in Tools Menu -> Options -> Environment -> fonts and colors.

7. Finding and replacement is very powerful, you can choose to use wildcards and regular expressions. Due to space relationships, please refer to MSDN for general contexts and regular expressions, I am here. Find or replace in the file, you can easily edit the lookup. You can use the scheduled search range, including the entire solution, VC contains directory, etc., you can also edit the detailed lookup range. For the lookup of the text file, the VC strip is looking for that efficiency than Windows files.

8. Press the following order to include the header file: #define crtdbg_map_alloc # incline

#include

Then write at the beginning of the program:

_CRTSETDBGFLAG (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

Thus, after the end of the retracted program, the memory leaks are dounted to the debug mode of the output sub-window.

Third, the compilation section: 1. If a big project, you need to include a lot of system header files, then you can write all of these headers to a stdafx.h file, then build a stdafx.cpp, inside Just a code, # include "stdafx.h", then click Right-click on Solution Manager -> Your Project, then press Properties -> Configuration Properties -> C / C -> Prefraction, Create / Use The pre-compiled head is set to: Create a pre-compiled head, and the following two will be filled in, if not, then fill in stdafx.h. Then put your project completely regenerates a editor, then enter the original option, set the creation / use pre-compiler to: Set the precompiled head. Ok, your project is currently compiled. 2. If your program needs to introduce a specific library, you can write on the source file that needs to be referenced: #pragma comment (lib, "xxx.lib") This does not need to configure Properties -> Links -> Enter I will set it up, so you can improve your code compatibility.

3. If you are writing the DLL, and this DLL is used by another project, but these two projects are not in the same folder, so you have to copy newly compiled DLLs every time. Debug in the directory of Exe, if you forget to update, this may waste you many times and energy. In fact, you can write a BAT file, use the dos command copy, complete the copy task you need, then put this BAT file into the DLL directory, then enter the configuration properties -> Generate event -> Generate the event -> command line Fill in the BAT file name you want to execute, and the copy task is automatically executed after the compilation is over.

4. Tools Menu -> Options -> Environment -> Projects and Solutions, you can display the task list window when you have an error. This will automatically pop up the task list after you find an error, and you will be able to double-click on a task.

4. Resource section 1. When editing the dialog, select a control and then list all of its properties in the properties sub-window. Press the lightning button above, it will list all of its available events, double-click one of the events, jump into the corresponding source file, then you can add a handler for an event of the control.

2. When using the MFC programming, the properties sub-window displays this class available overwriting function and event handler, and double-click to write code. If you find that the properties sub-window and code are not copied, you can select the class you need to edit in the class view, or click the right mock in the code editing to press the synchronization class view.

3. An icon file is actually a icon package, which can contain a lot of size, color different icons, and can be built, deleted, and modify icons in the icon compiler of VC.NET. This feature is complete in the new image type, current icon image type, and delete image types in the image menu.

4. When the menu edits, enter - in the CAPTION property of the menu item -, the menu item is automatically changed.

5. Debug section 1. In the Debug Menu -> Window Submenu, you can open these very useful debug auxiliary windows. The windows described below can be opened here.

2. Click the left button on the left side of the code editing to add a breakpoint for this line. Right-click this breakpoint to modify the properties of this breakpoint, such as setting this breakpoint, then stop, or is a conditional judgment statement when this breakpoint will stop and wait. The breakpoint window can be more detailed and managed on the breakpoint in the source file.

3. Auto window and local variables You can check the value of almost all current you need to view, and here you can modify the value of this variable. 4. Register window You can view the status of all registers. Right click in this window to open the registers you need to view.

5. Call the stack, this is very useful when an error occurs. For example, memory access error, then stopped on a line in the delete source file, then you can find it to see which true error stem statement by the stack.

6. Command window, you can write VC predefined commands, and even write part C code. For example, P = 5; this is completely ok, please refer to MSDN for specific available commands.

7. Monitor window, enter the name of the variable you need to view, it will be displayed behind. If it is an object, point the number in front, it will be listed below. If there is an array Int a [6], you can enter: a, 6, so you can view the value of all elements in this array. You can also convert formats, such as token, x. For more detailed complicated features, please refer to MSDN.

5. About Visualc 6.0 mode keyboard mapping mode common shortcuts General text editing partial formatted selected content: Ctrl K, Ctrl f forward positioning: Ctrl = backward positioning: Ctrl - Find: Ctrl F Find in the file: Ctrl Shift F Replace Ctrl H: Replace in the file: Ctrl Shift h Convert to uppercase: Ctrl Shift U conversion to lowercase: Ctrl U Note Selected content: Ctrl K , CTRL C Cancel: Ctrl K, Ctrl U open / close breakpoint: F9 Clear all breakpoints: CTR SHIFT F9 All Compile: F7 unit compile: Ctrl F7 single-step tracking: F10 Enter function: F11 Run to the cursor: CTRL F10 jump function: SHIFT F11 Run debug: F5 Stop debugging: SHIFT F5 restart debugging: Ctrl Shift F5 running does not debug: CTRL F5 Open / Close bookmark: Ctrl K, Ctrl K Previous bookmark: Ctrl K, Ctrl P Next Bookmark: Ctrl K, Ctrl N Clear All Bookmarks: Ctrl K, Ctrl L Open Properties Window: Alt ENTER Previous Document: Ctrl Tab Next document: Ctrl Shift Tab Open Project: Ctrl Shift O Open File: Ctrl O Save: Ctrl S All Save: Ctrl Shift S New File: CTRL N full screen display: Shift Alt ENTER

There are still many don't think of it, think of adding it again, and welcome all VC enthusiasts to add!

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

New Post(0)