Source Address: http://www.sunxin.org/forum/thread/4846.html
Visual c ++ 6.0 (5.0) development tools are very powerful, but for beginners, there are many details to note. The author collected and sorted out the following practical tips, hoping to help beginners.
1: When Using VC to develop a project, we often encounter this situation: it is clear that only one file is modified, but the entire project must be re-compiled and connected once. Just after the connection was established, I was prompted to re-compile the connection once, which is very annoying. This is because of the emergence of future documents. Solution: Find the DEBUG directory in the corresponding folder, delete all future files, and rebuild all. (In the future, files will be created and modified later than the system time)
2: Sometimes, the classview In the workspace is messy. The result is as follows: (1): the added member variables or functions cannot be displayed; (2): even if a variable or function is displayed, you cannot jump to the correct position after double-clicking. Solution: Delete the. NCB file and rebuild all.
3: How to delete a class cleanly? 1: First Delete the corresponding. h and. cpp files from FileView In workspace. 2. Close the project and delete the corresponding. h and. cpp files from the actual folder. 3. Delete the. CLW file. Open the project and rebuild all.
4: beginners often have the following questions: If you directly look at the project file to add a CPP original file and then compile the connection, you will always be prompted not to find the pre-compilation header solution: # include "stdafx. H"
5: how to add a defined class to the project? There are many methods. The following is a simple example: Select Insert/New Class Menu to bring up the dialog box; select class type to generic; and enter the class name. Of course, you can also decide the base class of the class.
6: How to import multiple projects in the workspace )? Open a project (*. DSP file), select another project file (*. DSP file), you can insert another project. In the classview view, right-click a project to activate it. inserting multiple projects in the workspace facilitates copying code and resources between different projects.
7: How to organize too many classes in the classview view? 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.
8: How to quickly delete temporary files in the debug folder of a project? In the FileView, right-click the project and choose clean.
9: It is very slow to edit a project with a large source file. What should I do? Do not open the project file (*. DSP file). Open a single source file (*. h or *. cpp) to edit. It is much faster.
10: 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. 11: 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.
12: how to position the cursor in the source file to symmetric {} and # If, # endif? The former uses the CTRL and "}" keys, and the latter uses the CTRL and "K" keys.
13: how to set the header file and library file in VC? In addition to the default VC header files and library files, if you often need to use third-party header files and library files, you can set them in the directories of Tools Options. If you only need to use this project, you can set the library file in project setting-> link object/library modules.
14: 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.
15: How do I add ODBC functions to an MFC application? (1) In the file stdafx. add the following line at the end of the H file: # include // mfc odbc database classes (2) edit the RC file in text mode (using file-> open as text) # include "L. CHS \ afxprint. RC "// printing/print preview resources add the next line: # include" L. CHS \ afxdb. RC "// database resources
16: After the database table is modified, how can I quickly update a crecordset record set bound to the table? Updatecoloumns and bind all are used after the record set class is selected under the member variables label in classwizard.
17: How can I find only executable code. EXE files? Use VC open file in NT to open the *. EXE file in resources mode, modify the resource file directly, and save the file.