Share via


Project Object

Home Page (Objects)OverviewFAQReference

The Project object represents a group of related files that can include one or more configurations.

The Project object has the following properties:

Properties
Application Type
Name FullName
Parent

Each project open in Developer Studio is represented by a Project object. This object has members (properties, methods, and events) that you can use to manipulate the project.

If a project includes configuration information, that project also has a BuildProject object. This object has all the members of a Project object and also has members that allow you to configuration-specific attributes of the project.

Use the project's Type property to determine which members you can access. If the type is "Build," the project is a build project and you can access BuildProject members as well as Project members.

In VBScript macros, you access BuildProject members by automatically using late binding. In Add-ins however, you can also access BuildProject members by using early binding. Early binding offers better performance than late binding by making calls into the interface faster at run time.

Using a Dual Interface to Access This Object

This section about dual interfaces is useful for writing add-ins or automating Developer Studio across processes. This section is not applicable to writing VBScript macros.

The Project object implements the IGenericProject dual interface. Through this interface, add-ins can directly access the members (properties, methods, and events) of this object and can employ early binding to make calls into these members faster at run time.

Add-ins written in Visual C++ can access members of the Project object by using the header files in Vc98\Include\objmodel. However, if you use the Developer Studio Add-in Wizard to create an add-in, the wizard automatically includes these header files in your source code.

The following table shows the header files you need for the Project object:

Header file Description
bldauto.h Declares the dual interfaces.
bldguid.h Declares the GUIDs used to identify the interfaces.
blddefs.h Declares additional information needed to use the interfaces, such as error IDs and enumerated constants.

Add-ins written in Visual Basic can access members of the Project object by using the Visual Studio '97 Project System type library, located in Msdev98\bin\ide\devdbg.pkg.

Note   In the Visual Basic References dialog box (Project menu, References command), the names of the type libraries begin with "Visual C++ 6.0" for Visual C++ version 6.0. For Visual C++ version 5.0, the names begin with "Visual Studio '97."