Describe how to enhance the functions of Visual C ++ Development Environment

Source: Internet
Author: User

Visual C ++ is currently one of the most popular C ++ integrated development environments on Windows platforms. It is developed by a large number of applications and software. The VC development environment provides powerful functions, providing strong support for developers to develop applications conveniently, quickly, and efficiently.

However, since programmers have their own characteristics and habits, there may be many different needs for programming and development environments. This is fully taken into account in the integrated development environment of vc ide. It provides a function to expand the development environment so that developers can, as needed, enhance the functions of the VC development environment through some programming development.

Visual C ++ automation Mechanism
When VC is used for development, many operations can be performed manually in the integrated development environment of VC, for example, opening a project, modifying source files, and saving files by using menu commands, then compile the connection to obtain executable files. Most of these operations are routine and repeated multiple times.

  • Exploring flexible C/C ++ language commands
  • Detailed description of the Test C ++ Test Tool
  • Example of testing C ++ Software
  • Explanation of various Error Methods for C ++ Unit Testing
  • How to better and more conveniently conduct the C ++ test Program

VC provides an extension mechanism for Automation (from previous OLE Automation. VC developers can develop VBScript macros or plug-ins to enable the IDE to automatically perform some operations. The advantage is obvious: it can greatly shorten the time for these operations, and avoid some errors that may occur during manual operations, such as omissions and typing errors. VBScript macro is a program written in VBScript language, while the plug-in is a COM component developed using VC or Visual Basic.

We can also use VBScript macros and plug-ins to beautify and transform the VC interface, such as adding a tab for the VC window (similar to the Delphi interface.

In a macro or plug-in, the integrated development environment of Visual C ++ and its components can be operated as objects. For example, you can open, edit, and close a file by operating on the objects corresponding to the project file. Similarly, an object corresponding to a window in IDE can activate a window and change the window size.

An object can be a component of the integrated development environment or a group of related components. For example, a Document object represents an open file, while a Document object represents all open files. Similarly, a Window object represents an opened Window, while a Windows Object represents all opened Windows. Documents and Windows objects are called collection objects. They contain a set of related objects.

Each object in the IDE environment implements a two-way interface that provides a large number of methods, attributes, and events, you need to use these methods, attributes, and events to operate these objects when developing VBScript macros and plug-ins. At the same time, each object implements an IDispatch interface and a COM interface for the Automation mechanism to support access to object members (attributes, methods, and events.

To better operate the objects in the integrated development environment, you must know the relationship between these objects. There is a hierarchical inclusion relationship between objects. The Application object is the top-level, and other objects belong to it. With this relationship, you can use the attributes and methods of the Application object to directly access all its subordinate objects! The objects in the VC integrated development environment and their inclusion relationships are as follows:

 
 
 
  1. Application
  2. Application (the Application can also contain itself)
  3. Projects
  4. Project
  5. Deployments
  6. Configuration
  7. Invocations)
  8. Documents
  9. Document
  10. Window (General Window)
  11. TextDocument
  12. TextSelection
  13. TextWindow
  14. Window (text Window)
  15. TextEditor
  16. Windows
  17. Debugger
  18. Breakpoints
  19. Breakpoint

For example, the Breakpoints object has a Breakpoint object as one of its attributes, that is, the Breakpoints object contains one or more Breakpoint objects. In this way, you can access all subordinate objects contained by an object through its attributes. In turn, you can use the Parent attribute of an object to access the object to which it belongs.
The object encapsulation mechanism of Visual C ++ provides great convenience for us to develop VBScript macros and plug-ins to expand the functions of the integrated development environment of VC. Next let's take a look at how to develop VBScript macros and ins, and use the Automation mechanism of VC to enhance the functions of the Visual C ++ development environment to facilitate our daily development work.

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.