Automating tasks in Visual C ++ by macro

Source: Internet
Author: User

[Msdn]

Objects and the object hierarchy

Home Page (objects) | overview | FAQ | reference

You can control the Visual C ++ developer studio environment programmatically by manipulating it through automation (formerly OLE Automation ). for example, in a VBScript macro, you can control an open document by manipulating its corresponding document object.

Each developer studio object implements a dual interface through which you can manipulate the object. Each object implementsIdispatchInterface for automation and a Component Object Model (COM) interface for direct access to object members (properties, methods, events ).

Add-ins written in Visual C ++ versions 5.0 or later, or visual basic versions 4.0 or later can employ early binding by using the COM interface. early binding makes all callinto interface members faster at run time.

Overview of each developer studio object

Each developer studio object is described below.

Object Represents
Application The developer Studio (Environment for Visual C ++) application.
Breakpoint A breakpoint, which is used for debugging purposes.
Breakpoints All the breakpoints set during a developer studio session.
Buildproject A project that contains build (configuration) information.
Configuration A set of settings to use for building a project.
Deployments All deployments in a project.
Debugger Enables you to inspect the execution of processes in the application in developer studio.
Document An open document.
Documents All open documents; a collection of one or moreDocumentAndTextdocumentObjects.
Project A group of related files.
Projects All projects in the currently open workspace.
Textdocument An open text file.
Texteditor The developer studio text editor.
Textselection Selected text in an Open Text Document.
Textwindow A view of an open text file.
Window A multiple document interface (MDI) Client window in which a document is being edited.
Windows A collection of windows; all open windows.

The developer studio object hierarchy for Automation

To manipulate developer studio objects, you must know the relationships between them. the application object is at the top, and the other objects are subordinate to it. this relationship allows you to directly access objects subordinate toApplicationObject by using the properties and methods ofApplicationObject.

The "has-a" tree is shown below. For example, the breakpoints object has, as one of its properties, a breakpoint object.

Application
   Application (Application is its own parent)
       Projects
           Project
               Configurations
                   Configuration
                       Configurations (circular)
       Documents
           Document
               Window (for "Generic" window types)
           TextDocument
               TextSelection
               TextWindow
               Window (for "Text" window types)
       TextEditor
       Windows
       Debugger
       Breakpoints
           Breakpoint
Related Article

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.