0
我知道我以前有過,但我不記得如何繞過它。Microsoft Access 2010託管代碼加載項 - 應用程序掛起
我構建了一個託管代碼加載項,除了一件事情之外,它還能正常工作。當我嘗試關閉Access應用程序時,應用程序窗口仍然存在,除非我結束任務。當我使用Visual Studio 2010調試外接程序時,它會在我停止調試時關閉。
我將所有變量設置爲斷開事件的一部分。
Public Sub OnDisconnection(ByVal RemoveMode As Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnDisconnection
'On Error Resume Next
If Not MenuCommandControls Is Nothing Then MenuCommandControls.Delete()
If Not MenuCommandDimensionVariable Is Nothing Then MenuCommandDimensionVariable.Delete()
If Not MenuCommandFields Is Nothing Then MenuCommandFields.Delete()
If Not MenuCommandForms Is Nothing Then MenuCommandForms.Delete()
If Not MenuCommandParseSQL Is Nothing Then MenuCommandParseSQL.Delete()
If Not MenuCommandQueries Is Nothing Then MenuCommandQueries.Delete()
If Not MenuCommandReports Is Nothing Then MenuCommandReports.Delete()
If Not MenuCommandTables Is Nothing Then MenuCommandTables.Delete()
If Not MenuCommandVariables Is Nothing Then MenuCommandVariables.Delete()
If Not searchForm Is Nothing Then searchForm.Close() : searchForm = Nothing
If Not ObjectSetting Is Nothing Then ObjectSetting = Nothing
If Not AccessInst Is Nothing Then AccessInst = Nothing
If Not addInInstance Is Nothing Then addInInstance = Nothing
'If Not FormParseSQL Is Nothing Then FormParseSQL = Nothing
applicationObject.Quit(Access.AcQuitOption.acQuitPrompt)
If Not applicationObject Is Nothing Then applicationObject = Nothing
End Sub