Private WithEvents m_DocEvt As DocumentEvents Private Sub IExtension_Startup(ByRef initializationData As Variant) On Error GoTo ErrorHandler Set objApplication = initializationData Exit Sub ErrorHandler: MsgBoxShow "IExtension_Startup: " & Err.Number & " " & Err.Source & " " & Err.Description, vbCritical End Sub Private Property Let IExtensionConfig_State(ByVal ExtensionState As esriSystem.esriExtensionState) On Error GoTo ErrorHandler If ExtensionState <> m_extState Then 'Activate If ExtensionState = esriESEnabled Then If InitializeExtension Then 'Our stuff Set m_DocEvt = objApplication.Document 'Hook events (*) Else ExtensionState = esriESUnavailable End If ElseIf ExtensionState = esriESDisabled Then Set m_DocEvt = Nothing StopExtension True 'Our stuff End If m_extState = ExtensionState End If Exit Property ErrorHandler: MsgBoxShow "IExtensionConfig_State LET: " & Err.Number & " " & Err.Source & " " & Err.Description, vbCritical End Property
It worked! Thanks for help.
We implemented only some events of IDocumentEvents (as common in VB6) and, until 10, it worked fine.
I wouldn't ever tryed your solution by myself.
Thanks again.
I have a similar problem. I tried also to implement all other events that were not used before ArcGIS 10. But the problem (arcgis crashes at exiting) remains! Have you or someone else really tried the suggestion?
Thank you.
We still have some older apps that are built with VB6 and I'm having some issues. After uninstalling 9.3 and installing 10.0, I can run my apps that use map, ToC, toolbar and license controls directly within VB6, but I get "out of memory" or "ClassFactory cannot supply requested class" when I try to run the stand-alone apps that were compiled from VB6. Any suggestions?
Dim pVer As IArcGISVersion Set pVer = New VersionManager pVer.LoadVersion esriArcGISEngine, "10.0"
Even if it's not well documented by ESRI for VB6 (there is no more SDK!), for running our VB6 standalone application on ArcGIS 10 runtime, we only added the following code before using any ArcObjects call or component:Dim pVer As IArcGISVersion Set pVer = New VersionManager pVer.LoadVersion esriArcGISEngine, "10.0"
This code require a reference to "ArcGisVersion 1.0 Type Library"
Hope this helps