forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComClassAttribute.xml
247 lines (223 loc) · 11.9 KB
/
ComClassAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<Type Name="ComClassAttribute" FullName="Microsoft.VisualBasic.ComClassAttribute">
<TypeSignature Language="C#" Value="public sealed class ComClassAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed ComClassAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:Microsoft.VisualBasic.ComClassAttribute" />
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>The <see langword="ComClassAttribute" /> attribute instructs the compiler to add metadata that allows a class to be exposed as a COM object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use `ComClassAttribute` to simplify the process of exposing COM components from Visual Basic. COM objects are very different from .NET Framework assemblies; without the `ComClassAttribute`, you need to follow a number of steps to generate a COM object from Visual Basic. For classes marked with `ComClassAttribute`, the compiler performs many of these steps automatically.
> [!NOTE]
> This attribute simplifies the creation of COM objects. To expose a class as a COM object, you must compile the project with the **Register for COM Interop** option selected in the **Build** section of the **Configuration Properties** dialog box.
> [!NOTE]
> Although you can also expose a class created with Visual Basic as a COM object for unmanaged code to use, it is not a true COM object. For details, see [COM Interoperability in .NET Framework Applications](~/docs/visual-basic/programming-guide/com-interop/com-interoperability-in-net-framework-applications.md).
## Examples
To run this example, create a new **Class Library** application and add the following code to a class module.
[!code-vb[VbCnAttributes#21](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbCnAttributes/VB/Class2.vb#21)]
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ComClassAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ComClassAttribute.#ctor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see langword="ComClassAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the constructor for the `ComClassAttribute` class to set the `ClassID`, `InterfaceID`, or `EventID` properties when applying the `ComClassAttribute` to a class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ComClassAttribute (string _ClassID);" />
<MemberSignature Language="ILAsm" Value=".method public specialname rtspecialname instance void .ctor(string _ClassID) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ComClassAttribute.#ctor(System.String)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="_ClassID" Type="System.String" />
</Parameters>
<Docs>
<param name="_ClassID">Initializes the value of the <see langword="ClassID" /> property that is used to uniquely identify a class.</param>
<summary>Initializes a new instance of the <see langword="ComClassAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the constructor for the `ComClassAttribute` class to set the `ClassID`, `InterfaceID`, or `EventID` properties when applying the `ComClassAttribute` to a class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ComClassAttribute (string _ClassID, string _InterfaceID);" />
<MemberSignature Language="ILAsm" Value=".method public specialname rtspecialname instance void .ctor(string _ClassID, string _InterfaceID) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ComClassAttribute.#ctor(System.String,System.String)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="_ClassID" Type="System.String" />
<Parameter Name="_InterfaceID" Type="System.String" />
</Parameters>
<Docs>
<param name="_ClassID">Initializes the value of the <see langword="ClassID" /> property that is used to uniquely identify a class.</param>
<param name="_InterfaceID">Initializes the value of the <see langword="InterfaceID" /> property that is used to uniquely identify an interface.</param>
<summary>Initializes a new instance of the <see langword="ComClassAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the constructor for the `ComClassAttribute` class to set the `ClassID`, `InterfaceID`, or `EventID` properties when applying the `ComClassAttribute` to a class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ComClassAttribute (string _ClassID, string _InterfaceID, string _EventId);" />
<MemberSignature Language="ILAsm" Value=".method public specialname rtspecialname instance void .ctor(string _ClassID, string _InterfaceID, string _EventId) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.ComClassAttribute.#ctor(System.String,System.String,System.String)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="_ClassID" Type="System.String" />
<Parameter Name="_InterfaceID" Type="System.String" />
<Parameter Name="_EventId" Type="System.String" />
</Parameters>
<Docs>
<param name="_ClassID">Initializes the value of the <see langword="ClassID" /> property that is used to uniquely identify a class.</param>
<param name="_InterfaceID">Initializes the value of the <see langword="InterfaceID" /> property that is used to uniquely identify an interface.</param>
<param name="_EventId">Initializes the value of the <see langword="EventID" /> property that is used to uniquely identify an event.</param>
<summary>Initializes a new instance of the <see langword="ComClassAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the constructor for the `ComClassAttribute` class to set the `ClassID`, `InterfaceID`, or `EventID` properties when applying the `ComClassAttribute` to a class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ClassID">
<MemberSignature Language="C#" Value="public string ClassID { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ClassID" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ComClassAttribute.ClassID" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a class ID used to uniquely identify a class.</summary>
<value>Read-only. A string that can be used by the compiler to uniquely identify the class when a COM object is created.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The constructor sets this property when the `ComClassAttribute` is applied to a class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="EventID">
<MemberSignature Language="C#" Value="public string EventID { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string EventID" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ComClassAttribute.EventID" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an event ID used to uniquely identify an event.</summary>
<value>Read only. A string that can be used by the compiler to uniquely identify an event for the class when a COM object is created.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The constructor sets this property when the `ComClassAttribute` is applied to a class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="InterfaceID">
<MemberSignature Language="C#" Value="public string InterfaceID { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string InterfaceID" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ComClassAttribute.InterfaceID" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an interface ID used to uniquely identify an interface.</summary>
<value>Read-only. A string that can be used by the compiler to uniquely identify an interface for the class when a COM object is created.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The constructor sets this property when the `ComClassAttribute` is applied to a class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="InterfaceShadows">
<MemberSignature Language="C#" Value="public bool InterfaceShadows { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool InterfaceShadows" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.ComClassAttribute.InterfaceShadows" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Indicates that the COM interface name shadows another member of the class or base class.</summary>
<value>A <see langword="Boolean" /> value that indicates that the COM interface name shadows another member of the class or base class.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Shadowing is when a member uses the same name as another member.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>