Can I execute the COM Only function? (Opposite <Runtime.InteropServices.ComVisible (False)>)

I have some functions in my VB.NET DLL that I can hide from my VB6 application using the following:

<Runtime.InteropServices.ComVisible(False)> _

But is there a way to make the function ONLY visible to COM clients, not to .NET assemblies?

That way, I can use common methods for the .NET side, avoiding the need for an instance declaration.

+5
source share
1 answer

, , , . , COM-, .NET-, . :

Imports System.Runtime.InteropServices

    Public Interface ITestInterface

    <ComVisible(True)> _
        Sub MyTestMethod()    
    End Interface

    <ComVisible(True)> _
    Public Class TestClass
        Implements ITestInterface

        Private Sub MyTestMethod() Implements ITestInterface.MyTestMethod
        End Sub
    End Class


, , : " , .NET, ".

+3

All Articles