启动对话框时,Visual Studio 2010宏会挂起。

| 我已经编写了一个宏,它会启动一个对话框,用户可以在其中从组合框中选择一个值。不幸的是,对话框显示出来,我得到一个沙漏,持续1到20秒。 我发现有几种工作方法似乎有帮助: 快速CTRL-Alt-Del,然后进行Escape。 单击任务栏中的旋转宏动画。 从任务栏最小化然后最大化对话框。 但是,这已经成为一种真正的痛苦,有谁知道导致这种情况的原因以及如何防止这种情况的发生? 我用来启动对话框的代码是
    Dim winptr As New WinWrapper()
    frm.ShowDialog(winptr)
\'\' This class is used to set the proper parent to any UI that you may display from within a macro.
Public Class WinWrapper
    Implements System.Windows.Forms.IWin32Window

    Overridable ReadOnly Property Handle() As System.IntPtr Implements System.Windows.Forms.IWin32Window.Handle
        Get
            Dim iptr As New System.IntPtr(DTE.MainWindow.HWnd)
            Return iptr
        End Get
    End Property
End Class
    
已邀请:
每当我的宏调用MsgBox函数时,我都会得到类似的挂断。 重新运行宏几次后,似乎挂断消失了(这可能是该错误的提示),但这也不是一个可行的解决方案。     
如果安装SP1,则存在多个错误修复程序,包括VS 2010挂起的修复程序和Visual Studio“虚拟内存不足错误”     
我认为Visual Studios 2010宏不支持Winforms。 http://msdn.microsoft.com/zh-CN/library/bxk3af4y.aspx   VS宏当前不支持Windows窗体。     
由于某种原因关闭VS Macro Editor对我来说可以更正此问题。我仍然看到2到3秒的延迟。     

要回复问题请先登录注册