[gme-users] Getting the IGMEOLEApp interface from GME.Application COM object

James H. Hill hillj at dre.vanderbilt.edu
Thu Nov 5 16:08:16 CST 2009


Hi,

I am trying to do some automation work with GME, but I am running into  
some minor problems. More specifically, I am trying to create an  
instance of the GME application without opening a project (i.e.,  
instantiate GME using the GME.Application ProgID). Right now, here is  
the code that I thought would do that:

  CComBSTR progid ("GME.Application");
  CComPtr <IGMEOLEApp> gme_app;
  HRESULT hr = gme_app.CoCreateInstance (progid);

I, however, keep getting an invalid interface cast/query error. I  
thought the above would work because in PERL I have the following code:

  sub get_gme ()
  {
    # Create an instance of GME.
    my ($gme) = Win32::OLE->new ('GME.Application', 'Exit')
      or die 'GME is not installed\n';

    return $gme;
  }

The object returned from the code above implements the IGMEOLEApp  
interface as expected because code like the following works:

    print get_gme ()->Version ();

So, does anyone know what interface I should query when I instantiate  
a GME.Application COM object, or how to get the IGMEOLEApp interface  
from the GME.Application COM object??

Thanks,

James


More information about the gme-users mailing list