ClassMicrosoft.VisualBasic.COMClassAttribute Applies ToClass ConstructorNew([classID[, interfaceID[, eventID]]][, interfaceShadows])
Properties
DescriptionThe <COMClass > attribute adds metadata to a class that exposes a .NET class as a COM object. You can supply the attribute with a class identifier, an interface identifier, and an event identifier. All are GUIDs that can be generated by using the guidgen.exe utility. Using this attribute ensures that the COM component retains the same GUIDs even when it is recompiled. ExampleThe example defines a simple class named Contact that includes the <COMClass> attribute. The GUIDs are in standard registry format except for the absence of the opening and closing braces. <COMClass(Contact.ClassID, Contact.InterfaceID, Contact.EventID)> _ Public Class Contact Friend Const ClassID As String = _ "C7BA6669-DCFB-43d6-9A74-B1BCC6EE467B" Friend Const InterfaceID As String = _ "72663B50-6A44-46e7-83B6-F1A4F149FF5F" Friend Const EventID As String = _ "BD2C0D5E-C0D7-4e1e-A9E8-AD29C8003D4B" Private contactName As String Private contactCity As String Private contactState As String Private contactZip As String Public Property Name( ) As String Get Return contactName End Get Set(ByVal value As String) contactName = value End Set End Property Public Sub New( ) MyBase.New( ) End Sub End Class See AlsoMarshalAs Attribute |