VCCodeIDLCoClass 介面

定義

在 .idl 檔中定義 CoClass 元素的物件。An object defining a CoClass element in a .idl file.

public interface class VCCodeIDLCoClass
public interface class VCCodeIDLCoClass
__interface VCCodeIDLCoClass
[System.Runtime.InteropServices.Guid("D9934CD0-5E33-4744-A939-664BE7E1B6D9")]
[System.Runtime.InteropServices.TypeLibType(System.Runtime.InteropServices.TypeLibTypeFlags.FDispatchable | System.Runtime.InteropServices.TypeLibTypeFlags.FDual)]
public interface VCCodeIDLCoClass
[<System.Runtime.InteropServices.Guid("D9934CD0-5E33-4744-A939-664BE7E1B6D9")>]
[<System.Runtime.InteropServices.TypeLibType(System.Runtime.InteropServices.TypeLibTypeFlags.FDispatchable | System.Runtime.InteropServices.TypeLibTypeFlags.FDual)>]
type VCCodeIDLCoClass = interface
Public Interface VCCodeIDLCoClass
屬性

範例

此範例會抓取第一個 CoClass 程式碼語句,並將它顯示在訊息方塊中。This example retrieves the first CoClass code statement and displays it in a message box.

Sub GetFirstCoClass()  
    Dim vcCM As VCCodeModel  
    Dim vcIDLCoClass As VCCodeIDLCoClass  
    vcCM = DTE.Solution.Item(1).CodeModel  
    vcIDLCoClass = vcCM.IDLLibraries.Item(1).IDLCoClasses.Item(1)  
    MsgBox(vcIDLCoClass.DisplayName)  
End Sub  

備註

VCCodeIDLCoClass物件表示父解決方案的 .idl 檔中的 CoClass 程式碼專案。The VCCodeIDLCoClass object represents a CoClass code element from the .idl file of the parent solution. 此物件主要是用來存取現有 CoClass 程式碼專案的元素。Primarily, this object is used to access the elements of an existing CoClass code element.

請參閱 如何:編譯 Visual c + + 程式碼模型 擴充性的範例程式碼,以取得如何編譯和執行此範例的相關資訊。See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

屬性

Attributes

取得物件的所有屬性集合。Gets a collection of all of the attributes for the object.

BodyText

取得或設定物件的內文。Gets or sets the body text of the object.

Children

取得這個程式碼建構內所含物件的集合。Gets a collection of objects contained within this code construct.

CodeModel

取得此專案的 VCCodeModel 物件。Gets the VCCodeModel object for the project.

Collection

取得集合,這個集合包含支援這個屬性的物件或這個程式碼建構內所含的物件。Gets the collection containing the object supporting this property or contained within this code construct.

Comment

取得或設定與此程式碼項目關聯的註解。Gets or sets the comment associated with the code element.

DeclarationText

取得或設定物件的宣告。Gets or sets the declaration of the object.

DisplayName

取得物件的完整名稱。Gets the full name of the object.

DTE

取得最上層的擴充性物件。Gets the top-level extensibility object.

EndPoint

取得位於程式碼項目結尾的編輯點。Gets the edit point that is the location of the end of the code item.

EndPointOf[vsCMPart, vsCMWhere]

取得父物件的結束點。Gets the end point of the parent object.

Extender[String]

取得要求的 Extender 物件 (若此物件可以使用)。Gets the requested Extender object if it is available for this object.

ExtenderCATID

取得物件的 Extender 分類 ID (CATID)。Gets the Extender category ID (CATID) for the object.

ExtenderNames

取得物件的可用 Extender 清單。Gets a list of available Extenders for the object.

File

取得宣告物件的檔案。Gets the file in which the object is declared.

FullName

取得物件檔案的完整路徑和名稱。Gets the full path and name of the object's file.

InfoLocation

取得程式碼模型的功能。Gets the capabilities of the code model.

IsCaseSensitive

取得值,表示程式碼項目是否區分大小寫。Gets a value indicating whether a code element is case-sensitive.

IsCodeType

取得值,其會指出 CodeType 物件是否可以從此物件取得。Gets a value indicating whether a CodeType object can be obtained from this object.

IsInjected

取得值,表示程式碼項目是否已經由屬性或巨集展開插入。Gets a value indicating whether a code element has been injected by an attribute or macro expansion.

IsReadOnly

取得值,表示包含物件的檔案是否唯讀。Gets a value indicating whether the file containing the object is read-only.

IsZombie

取得值,指出父物件是否存在。Gets a value indicating whether the parent object exists.

Kind

取得列舉類型,表示物件類型。Gets an enumeration indicating the type of object.

Language

取得用以撰寫程式碼的程式設計語言。Gets the programming language used to author the code.

Location[vsCMWhere]

取得物件宣告的位置。Gets the location of the object declaration.

Name

取得或設定物件的名稱。Gets or sets the name of the object.

Parent

取得 VCCodeIDLCoClass 物件的直屬父物件。Gets the immediate parent object of a VCCodeIDLCoClass object.

Picture

取得要在使用者介面中當做圖示使用的圖片 Automation 物件。Gets a picture automation object to be used as an icon in the user interface.

Project

取得與物件關聯的 Project 物件。Gets the Project associated with the object.

ProjectItem

取得 ProjectItem 與指定物件相關聯的物件。Gets the ProjectItem object associated with the given object.

StartPoint

取得定義程式碼項目開頭的 TextPoint 物件。Gets a TextPoint object that defines the beginning of the code item.

StartPointOf[vsCMPart, vsCMWhere]

取得物件的起點。Gets the start point of the object.

方法

AddAttribute(String, String, Object)

建立新的屬性程式碼建構,並將該程式碼插入正確的位置。Creates a new attribute code construct and inserts the code in the correct location.

GetEndPoint(vsCMPart)

取得物件 TextPoint,其會標示程式碼項目定義的結尾。Gets a TextPoint object that marks the end of the code element definition.

GetStartPoint(vsCMPart)

取得定義程式碼項目定義開頭的 TextPoint 物件。Gets a TextPoint object that defines the beginning of the code element definition.

IsSelf(Object)

判斷指定的程式碼項目是否與其他程式碼項目相同。Determines if the specified code element is the same as another code element.

適用於