VC programming skills Collection - From vckbase.com

xiaoxiao2021-03-06  21

VC Programming Skills Collection (Hangwire Posted 2001-12-29 8:39:30)

[Question 1]: Solve the ClassView display of Workspace

[answer]

That is, the added member variable or function cannot be displayed; even if the variable or function is displayed, double-click to the correct location. Delete .ncb file, then rebuild all, you can.

[Problem 2]: Simple way to join your own defined class to your project

[answer]

Select the Insert / New Class menu, pop up the dialog, select Class Type for generic, enter the class name. Of course, you can also determine the base class of this class.

[Issue 3]: Import multiple projects in Workspace (Project)

[answer]

After opening a project (* .dsp file), select the Insert Project Into Workspace submenu in the "Project" menu, then select another project file (* .dsp file) to insert another project. In the ClassView view, the right click can activate one of the items, and the workspace is inserted into multiple projects. It can be easily copied between different items, resources, etc.

[Question 4]: Solving too many classes in the ClassView view

[answer]

We can first click New Folder in the ClassView view, and then drag the class with similar properties to the corresponding folder, so that the entire view looks clear.

[Problem 5]: Quick Delete Project Under the Debug Folder Temporary File

[answer]

Select the corresponding item in the FileView view, right click Clean.

[Question 6]: Quickly open a large project with a large file

[answer]

Do not open the project file (* .dsp file), open the single source file (* .h or * .cpp) to edit (* .h or * .cpp) to edit, it is much better.

[Question Seventh]: Quickly generate a new project with existing projects except for project extensions

[answer]

Using the File menu to generate the Custom Appwizard in a new project, select An EXISTING Project, then select the project file name (* .dsp) finish of the existing project, then generate one can generate the same, which can be the same but you can re-name Project AppWizard. You can use it like MFC AppWizard. If you don't want to use it, you can delete this Wizard and .pdb file in the COMMON / MSDEV98 / TEMPLATE directory in the VC installation directory.

[Question 8]: Set the header file and library file in the VC

[answer]

In addition to the VC default header files and library files, if you often use a third-party header file and library files can be set in the Directories for Tools Options. If you are just this project, you can set the library file in the Project Setting-> Link Object / Library Modules.

[Question Nine]: Let the console application support the MFC class library

[answer]

You can introduce the MFC library in the console application, but the console application is single-threaded, MFC is multi-threaded, in order to solve this contradiction, in the Project Setting-> C / C option, select Code Generation, Select Debug Multithread in the Use Run-Time Library drop-down box.

[Question 10]: After the database table changes, quickly update a CRecordset recordset that binds to the table [Solution]

Use UpdateColoumns and Bind ALLs after selecting the record category under the MEMBER VARIABLES tab.

[Question 11]: Hanhua only the executable code .EXE file

[answer]

In the VC Open file, open the * .exe file in the resources, modify the resource file directly, and save it.

[Question 12]: How to clean and delete a class

[answer]

How to completely delete a class when programming with VC? We can do this:

First, remove the corresponding .h and .cpp file from the FileView in Workspace; then turn off the project, remove the corresponding .h and .cpp file from the actual folder; then delete the .clw file. Since then, open the project, Rebuild All. In this way, we thoroughly remove a class that useless to us.

[Question 13]: How to solve the VC incorrect connection problem

[answer]

When using the VC development project, this will often encounter this situation: clearly changed only a file, but all the entire project is re-connected once. Just connected, once, and prompt to recompile the connection once, very annoying. This is because there is a future file.

We can deal with it: find out the DEBUG directory under the corresponding folder, create and modify the time than the system time late DELETE, then Rebuild All. Everything will be OK.

[Question 14]: In MSVC 6, sometimes when you add a member variable via Class Wizard, some will disappear from the class view, usually in the application's dialog box class, the solution is as follows:

[answer]

Save Workspace first, then turn off the project, delete the .ncb file in this project directory, and then reopen Workspace.

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

New Post(0)