01-13-2021 12:09 AM
When starting the program via:
gobjGeoApp = CType(CreateObject("Geomedia.Application"), geomedia.Application)
I get the following error message: The ActiveX component cannot be created.
On the other hand, I open Geomedia and use the GetObject method instead of CreateObject:
gobjGeoApp = CType(GetObject(, "GeoMedia.Application"), geomedia.Application)
it works. I'm using Geomedia version 16.6.0 build 1200 and Visual Studio 2019.
I have included the following references:
I cannot currently explain why it is. Can you help me with the problem?
01-13-2021 02:44 PM - edited 01-13-2021 02:45 PM
Did you ever try without type casting?
Dim gobjGeoApp as Object
gobjGeoApp = CreateObject("Geomedia.Application")
Btw: You have to use Strict Off for this.
01-14-2021 02:21 AM
Thank you for your prompt reply. I tested your Code in a new VB project, unfortunately without success. The error message remains the same.
01-18-2021 02:44 AM
I tried with GM 18.104.22.1680 and VS2010. Works without problems.
Maybe your GM installation is corrupt or there is a problem with the combination GM & VS2019.
Have no others ideas, sorry.
01-18-2021 04:56 AM
I don't know either. If you have a reproducible test case you probably need to file a support ticket. GM 16.6 is built with VS2017 and is compatible with VS2019 so hopefully that's not the issue! - Hal
01-18-2021 07:59 AM
I tested the test.vbs program to rule out VB2019 as the cause.
SET gobjGeoApp = CreateObject("Geomedia.Application")
SET objDoc = gobjGeoApp.Open("c:\Geoworkspaces\USSampleData.gws")
gobjGeoApp.Visible = True
The same error message appears.
My installation may be corrupt. I'll check that and maybe redo.