Tips for Visual C ++ 6.0 (vc6)

Source: Internet
Author: User
1) Sometimes, during compilation, the computer suddenly shuts down illegally (maybe someone accidentally hits the power or your memory is unstable ). After you restart the machine, open the project and re-compile it. Then, the VC will crash. You may think that your VC compiler is broken, but it is not (you should try to compile other projects !), You only need to delete the. NCB,. Opt,. APs,. CLW files of the project and all files in the debug and release directories, and then recompile the files.
.

2) If you want to share your Source code Project, but copying the entire project is too large. You can delete the following files:. DSW,. NCB,. Opt,. APs,. CLW,. PLG, and all files in the debug and release directories.

3) when your workspace contains multiple projects, you may not be able to intuitively and intuitively see which project is the current one. You can set the settings as follows: Tools-> options-> Format, select workspace window in category, and change its default font (for example, set it to fixedsys.

4) how to change the name of an existing project? Turn off the project. Open the. DSP file in text format and replace the original project name.

5) vc6 is useful for smart prompting of class members, but sometimes it fails. You can close the project first. CLW and. delete NCB and re-open the project. Click View> classwizard in the menu item. In the displayed dialog box, click "add all" and rebuild all. Should be able to solve Problem .

1. Detection Program Matching brackets
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.
Fortunately, it can also see Microsoft-defined system macros, which are very good.

3. Format a 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 to symmetric # If, # endif in the source file, 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 open different Lib.

8. How to add the system header file (. h) to the current project.
# Include <FILENAME. h>, which indicates that the file is compiled to the VC system directory. Use # include "filename. H" to indicate that the file is compiled in the current directory.
Directory searching.

9. How to Use Assembly debugging in Studio
Press Ctrl + f7in the workbench debugger status.

10. How to Handle System messages that classziard cannot find
If you want to process system messages such as wm_nchittest in classwizard, Set
Change message filter to window.

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. 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.

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 the Wizard from 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.

Appendix: VC project file description
. DSP project parameter configuration file, which is too important and focuses on Object protection ..
The. DSW workspace file is of average importance because it is easy to recover because its information is not mine.
The following files can be discarded in the project. Some files are automatically generated by the VC after they are deleted.
. 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.
. NCB does not compile the browsing file (No compile browser ). You can delete this file when the Automatic completion function fails. It is automatically generated after build.
The. Opt project parameter file for the development environment. Such as the tool bar location and other information; (can be discarded)
. APS (appstudio file), Resource auxiliary file, binary format, usually don't worry about it.
. 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.

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.