Vb6 migration InteropForms类方法在VB6中不可见

Vb6 migration InteropForms类方法在VB6中不可见,vb6-migration,Vb6 Migration,我在VS2010中使用项目模板构建了一个简单的InteropForms类。它成功构建并在系统中注册库。我可以在VB6中看到并引用它,但我在VS2010中添加到类中的公共方法或属性都不可见 我做错了什么 Imports Microsoft.InteropFormTools <InteropForm()> _ Public Class frmWebBrowserPreview Private Sub frmWebBrowserPreview_KeyUp(sender As Sy

我在VS2010中使用项目模板构建了一个简单的InteropForms类。它成功构建并在系统中注册库。我可以在VB6中看到并引用它,但我在VS2010中添加到类中的公共方法或属性都不可见

我做错了什么

Imports Microsoft.InteropFormTools

<InteropForm()> _
Public Class frmWebBrowserPreview
    Private Sub frmWebBrowserPreview_KeyUp(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
        If e.KeyCode = Windows.Forms.Keys.Escape Then Hide()
    End Sub

    Private Sub frmWebBrowserPreview_MouseUp(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
        Hide()
    End Sub

    Private Sub wbrPreview_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles wbrPreview.DocumentCompleted
        wbrPreview.Visible = True
    End Sub

    ''' <summary>
    ''' Navigate to the specified URL
    ''' </summary>
    ''' <param name="strURL">The URL string</param>
    Public Function Navigate(strURL As String) As Boolean
        wbrPreview.Navigate(strURL)
    End Function
End Class
导入Microsoft.InteropFormTools
_
公共类frmWebBrowserPreview
私有子frmWebBrowserPreview_KeyUp(发送方作为System.Object,e作为System.Windows.Forms.KeyEventArgs)处理MyBase.KeyUp
如果e.KeyCode=Windows.Forms.Keys.Escape,则隐藏()
端接头
私有子frmWebBrowserPreview_MouseUp(发送者作为System.Object,e作为System.Windows.Forms.MouseEventArgs)处理MyBase.MouseUp
隐藏()
端接头
私有子wbrPreview_DocumentCompleted(发件人作为对象,e作为System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)处理wbrPreview.DocumentCompleted
wbrPreview.Visible=True
端接头
''' 
''导航到指定的URL
''' 
''URL字符串
公共函数导航(strURL作为字符串)为布尔值
wbrPreview.Navigate(strURL)
端函数
末级

该模板来自工具箱:VB6 InteropForm库

VS2012中不支持它(但…)。。。

我想出来了。您必须向所讨论的方法添加InteropFormMethod属性,然后重新构建包装器

    ''' <summary>
''' Navigate to the specified URL
''' </summary>
''' <param name="strURL">The URL string</param>
<InteropFormMethod()> _
Public Function Navigate(strURL As String) As Boolean
    wbrPreview.Navigate(strURL)
End Function
“”
''导航到指定的URL
''' 
''URL字符串
_
公共函数导航(strURL作为字符串)为布尔值
wbrPreview.Navigate(strURL)
端函数

您指的是哪个项目模板?我甚至从未听说过Microsoft Interop Forms Toolkit。它看起来不受支持。我最近升级到VS2012,该工具包似乎正在工作。此外,有关的导航方法在VB6中可见,并且工作正常。然而,我认为这是正确的,所以我将其标记为答案。