Hi,even if a know VB6 is no more supported on ArcGIS 10 as a development tool, it has also been said that applications written in VB6 for earlier versions of ArcGIS (read 9.3.1) are expected to run on version 10 (http://events.esri.com/uc/QandA/index.cfm?fuseaction=answer&conferenceId=2F6DC1A1-1422-2418-883C3868...).We have a VB6 ArcMap extension and for now we cannot afford migrating all that code to VB.NET. I thing we're not alone in this kind of situation.So we are now trying to make that extension work on ArcGIS 10.We needed to hook some document events, so we put this code: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
In ArcGIS 10, if we hook DocumentEvents in (*), when the first event is fired (NewDocument, OpenDocument, CloseDocument), even without writing any code in events procedure, ArcMap exits with AV ("ArcGIS Desktop has encountered a serious application error....")Is someone experiencing this same problem? Maybe ESRI forgot to update this class (DocumentEvents) that is specific for VB6? But what about VBA code?Thanks in advanceFederico Albesano