Altova MapForce 2024 Enterprise Edition

El siguiente fragmento de código JScript inicia y cierra la aplicación. Si ya se está ejecutando una instancia de la aplicación, se llama a esa aplicación.

 

Nota:En la versión de 32 bits de MapForce el nombre registrado o identificador programático (ProgId) del objeto COM es MapForce.Application. Para la versión de 64 bits de MapForce el nombre es MapForce_x64.Application.

 

// Initialize application's COM object. This will start a new instance of the application and
// return its main COM object. Depending on COM settings, a the main COM object of an already
// running application might be returned.
 
try {   objMapForce = WScript.GetObject("", "MapForce.Application");   }
catch(err) {}
 
if( typeof( objMapForce ) == "undefined" )
{
  try   {   objMapForce = WScript.GetObject("", "MapForce_x64.Application")   }
  catch(err)
  {
     WScript.Echo( "Can't access or create MapForce.Application" );
     WScript.Quit();
  }
}
 
// if newly started, the application will start without its UI visible. Set it to visible.
objMapForce.Visible = true;
 
WScript.Echo(objMapForce.Edition + " has successfully started. ");
 
objMapForce.Visible = false; // will shutdown application if it has no more COM connections
//objMapForce.Visible = true;   // will keep application running with UI visible

 

El fragmento de código anterior está disponible como archivo simple (véase JScript Examples). Para ejecutar el script, inícielo desde la línea de comandos o desde el explorador de Windows.

© 2018-2024 Altova GmbH