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 9.3, you had to add a License Control to your form and you could right-click and go to properties and check the types of Product licenses you wanted your app to work with(ArcGIS Engine, ArcGIS Engine Enterprise GeoDatabase, ArcView, ArcEditor and ArcInfo). When your app ran, it would automatically pick the correct license. Since I now would have to pass productCode to pVer.LoadVersion, can I call pVer.LoadVersion multiple times passing it different productCodes to get the same effect? Or do I have to try and determine the correct productCode license through code to use or maybe have the user select what license they have in order to apply the correct one?
If Not ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine) Then If Not ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop) Then MessageBox.Show("Unable to bind to ArcGIS runtime. Application will be shut down.") e.Cancel = True 'Abort application start up End If End If
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
Dim pVer As IArcGISVersion Set pVer = New VersionManager pVer.LoadVersion esriArcGISEngine, "10.0"
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?
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.
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.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.