本文整理匯總了VB.NET中System.Runtime.InteropServices.ClassInterfaceType枚舉的典型用法代碼示例。如果您正苦於以下問題:VB.NET ClassInterfaceType枚舉的具體用法?VB.NET ClassInterfaceType怎麽用?VB.NET ClassInterfaceType使用的例子?那麽, 這裏精選的枚舉代碼示例或許可以為您提供幫助。
在下文中一共展示了ClassInterfaceType枚舉的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: AClassUsableViaCOM
' 導入命名空間
Imports System.Runtime.InteropServices
' Have the CLR expose a class interface (derived from IDispatch) for this type.
' COM clients can call the members of this class using the Invoke method from the IDispatch interface.
<ClassInterface(ClassInterfaceType.AutoDispatch)> _
Public Class AClassUsableViaCOM
Public Sub New()
End Sub
Public Function Add(ByVal x As Int32, ByVal y As Int32) As Int32
Return x + y
End Function
End Class
' The CLR does not expose a class interface for this type.
' COM clients can call the members of this class using the methods from the IComparable interface.
<ClassInterface(ClassInterfaceType.None)> _
Public Class AnotherClassUsableViaCOM
Implements IComparable
Public Sub New()
End Sub
Function CompareTo(ByVal o As [Object]) As Int32 Implements IComparable.CompareTo
Return 0
End Function 'IComparable.CompareTo
End Class