Vc6.0 usage tips

Source: Internet
Author: User

Vc6.0 usage tips favorites
1. Check whether parentheses in the program match
Move the cursor to the brackets to be checked (such as braces {}, square brackets [], Parentheses (), and angle brackets <>), and press Ctrl +]. If the brackets match correctly, the cursor jumps to the matching brackets. Otherwise, the cursor does not move and the chassis horn generates a warning.

2. view the macro definition of a macro (or variable or function)

Move the cursor to a macro You Want To Know. For example, on the most common declare_map_message, click F12 (or right-click go to defition ...), If browse files is not created, a dialog box is displayed. Click OK. Then, the page jumps to the location where those objects are defined.

3. Format a piece of messy source code

Select the source code and press ATL + F8.

4. The member variables or functions cannot be displayed during editing.

Delete the. NCB file and reopen the project.

5. How to organize a large number of classes in the classview

You can right-click the classview view to create a folder (new folder) and drag classes of similar properties to the corresponding folder to make the entire view clear.

6. Specify the pre-processing position.

Locate the cursor in the source file to symmetric # If, # endif, and use Ctrl + K.

7. How to add Lib in the system to the current project

In project | Settings | link | object/library modules: Enter the Lib name, and use an empty grid to separate lib files.

8. How to add the system header file (. h) to the current project.

# Include <FILENAME. h>: indicates to compile the file to the VC system directory. Use # include "filename. H" to find the file in the current directory.

9. How to Use Assembly debugging in Studio

In the workbench debugger status, press Ctrl + F7.

10. How to Handle System messages that classziard cannot find

If you want to process system messages such as wm_nchittest in classwizard, change the message filter to window on the class info page of classwizard.

11. How to delete a class cleanly

Delete the corresponding. h and. cpp files from the FileView In workspace, close the project, and delete the corresponding. h and. cpp files and. CLW files from the actual folder.

12. If you want the console application to support the MFC class library

You can include the MFC library in the console application, but the console application is single-threaded by default, and the MFC is multi-threaded. To solve this problem, in the project setting-> C/C ++ option, select code generation and select debug multithread in the use run-time library drop-down box.

13.if he has only the executable code. EXE file

Use VC open file in NT to open the *. EXE file in resources mode, modify the resource file directly, and save the file.

12. quickly switch two files in Studio
Sometimes, we need to quickly switch between the two recently used files and change to Ctrl + F6. This is useful when two files are different.

13. Obtain the preprocessing result of the source program:
In studio, you can choose-> Project-> Settings-> C/C ++-> project options, add the/P/EP compilation switch at the end to enable "only preprocessing ". you can. After compilation, you can find the text file named "file name. I" in the source program directory. This is the result after preprocessing.
(Note: use big setting/P to differentiate the size)


14. In debug mode, view the returned values after winapi call:
Simple and practical: Add @ HR and err to watch. For more details, see.


15. compile code that generates the specified source program file:
Open the Project Settings from project> setting in the IDE menu and follow the following file:
1. Select a specified file on the left. You can select multiple files.
2. on the C ++ properties page on the right, select list files in category, and then select assembly and source code (or other) in List Files type ), finally, in list file name, enter the corresponding compilation code file generated in a C/C ++ source file.
3. Compile the entire project.


16. manually compile pure resources into dll:
Rc.exe/V Data. RC
Cvtres.exe/machine: ix86 data. Res
Link/subsystem: Windows/dll/noentry data. Res; compiled into a DLL file
The DLL created in this way is the smallest, which is smaller than the one generated by Win 32 dynamic libray.

17: How to quickly generate a new project with the same project name as the existing project?

Use the "file" menu to generate the custom Appwizard in the new project, select an existing project, and select the project name of the existing project (*. DSP) finish. After compilation, an Appwizard is generated for a project that is the same as an existing project but can be renamed again. You can use it like using MFC Appwizard. If you do not want to use it, you can delete the. awx and. PDB files in this wizard in the common/msdev98/template directory under the VC installation directory.

18: If you want to copy the entire project to a floppy disk, which files can be deleted?

In addition to deleting the debug folder in the project folder, files such as. NCB,. CLW, And. Opt can also be deleted. These files can be rebuilt all and can be regenerated.

S Appendix: VC project file description

The. Opt project parameter file for the development environment. Such as the tool bar position and other information;

. APS (appstudio file), Resource auxiliary file, binary format, usually don't worry about it;

. The CLW classwizard information file is actually in the INI file format. If you are interested, please study it. sometimes the classwizard has a problem. You can manually modify the CLW file to solve the problem. if this file does not exist, you will be prompted to re-create it each time you use classwizard;

. DSP (workflow studio project): A project file in the text format. If you are not familiar with it, Do not manually modify it. DSW (workflow studio workspace) is a workspace file. Other features are similar to those of DSP;

. PLG is a compilation information file. The error and warning information files during compilation (actually an HTML file) are generally of little use. there is an option in tools-> options to control the generation of this file;

. HPJ (help project) is the project for generating help files, which can be processed using microsfot help compiler;

. MDP (Microsoft devstudio project) is an earlier version of the project file. To open this file, you will be prompted to convert it to a new DSP format;

. BSc is used to browse project information. This file is required if source Brower is used. if you do not need this function, you can remove the generate browse info file in project options to speed up compilation;

. Map is the image information record file of the execution file, unless you are very familiar with the underlying system, this file is generally not needed;

. PCH (pre-compiled file) is a pre-compiled file, which can speed up compilation, but the file is very large;

. PDB (Program database) Records Program-related data and debugging information, which may be useful during debugging;

. Exp is generated only when the DLL is compiled, and some information in the DLL file is recorded. It is generally useless;

. NCB does not compile the browsing file (No compile browser ). You can delete this file when the Automatic completion function fails. Automatically generated after build

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/lhsxsh/archive/2008/10/30/3182727.aspx

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.