[gme-users] how to convert .mga -> .xmp from a script?

Zoltan Molnar zoltan.molnar at vanderbilt.edu
Tue Jun 29 18:01:37 CDT 2004


In the code snippet Peter proposed if you replace the GME_EMBEDDED_START
with GME_SILENT_MODE ( = 128) then the metainterpreter will execute silently
and will produce its output xmp file in c:\temp.

COMTHROW(mgaLauncher->RunComponent(progID, mgaProject, NULL, NULL,
 GME_EMBEDDED_START));

Corresponding to this, any BON(2) interpreter could do a test in 

void Component::invokeEx( Project& project, FCO& currentFCO, const
std::set<FCO>& setSelectedFCOs, long lParam )
{
  bool silent_mode = (lParam == GME_SILENT_MODE);
  ...
}

For such a metainterpreter for GME4.5.18 see
\\isis-server2\user\zolmol\meta_int

Zoli

> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu 
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf 
> Of Peter Volgyesi
> Sent: Wednesday, June 16, 2004 2:47 AM
> To: 'A list for GME users to share thoughts and discuss bugs 
> and fixes.'
> Subject: RE: [gme-users] how to convert .mga -> .xmp from a script?
> 
> 
> If your .mga file contains a valid meta-model, you can invoke 
> the meta interpreter programmatically. The following code 
> snippet can be used in a BON2 interpreter/plug-in:
> 
> CComPtr<IMgaProject> mgaProject = project->getProjectI(); 
> ASSERT(mgaProject);
> 
> CComPtr<IMgaTerritory> terr;
> COMTHROW( mgaProject->get_ActiveTerritory(&terr));
> ASSERT(terr);
> 
> try {
> 	COMTHROW( mgaProject->CommitTransaction() );
> 	CComPtr<IMgaLauncher> mgaLauncher;
> 	
> COMTHROW(mgaLauncher.CoCreateInstance(OLESTR("Mga.MgaLauncher")));
> 	CComBSTR progID("MGA.Interpreter.MetaGME 2004");
> 	COMTHROW(mgaLauncher->RunComponent(progID, mgaProject, 
> NULL, NULL, GME_EMBEDDED_START));
> 	COMTHROW( mgaProject->BeginTransaction(terr) );
> } 
> catch (BON::Exception&) {
> 	AfxMessageBox("Something went wrong...");
> }
> 
> --
> peter
>  



More information about the gme-users mailing list