GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 6
Registered: ‎01-12-2021

The createObject method with Geomedia does not work

When starting the program via: 

gobjGeoApp = CType(CreateObject("Geomedia.Application"), geomedia.Application)

 

geomedia_error.jpg

 

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:

 

references_geomedia.jpg

 

 

I cannot currently explain why it is. Can you help me with the problem?

 

Regular Contributor
Posts: 234
Registered: ‎05-25-2016

Re: The createObject method with Geomedia does not work

[ Edited ]

Hi ThomasG

 

Did you ever try without type casting?

 

Something like

Dim gobjGeoApp as Object

gobjGeoApp = CreateObject("Geomedia.Application")

 

Btw: You have to use Strict Off for this.

Occasional Contributor
Posts: 6
Registered: ‎01-12-2021

Re: The createObject method with Geomedia does not work

Hi hesrah,

 

Thank you for your prompt reply. I tested your Code in a new VB project, unfortunately without success. The error message remains the same.

Regular Contributor
Posts: 234
Registered: ‎05-25-2016

Re: The createObject method with Geomedia does not work

Hi ThomasG

 

I tried with GM 16.6.0.1200 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.

Technical Evangelist
Technical Evangelist
Posts: 434
Registered: ‎02-03-2016

Re: The createObject method with Geomedia does not work

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

Occasional Contributor
Posts: 6
Registered: ‎01-12-2021

Re: The createObject method with Geomedia does not work

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.

Occasional Contributor
Posts: 6
Registered: ‎01-12-2021

Re: The createObject method with Geomedia does not work

The following error message appears:

 

error_Vbs.JPG

Occasional Contributor
Posts: 6
Registered: ‎01-12-2021

Re: The createObject method with Geomedia does not work

It works now. I deleted a lot of old Geomedia installations before I reinstalled Geomedia.
Thanks for your help

Regular Contributor
Posts: 234
Registered: ‎05-25-2016

Re: The createObject method with Geomedia does not work

well done Cat Very Happy