Altova UModel 2024 Professional Edition

Mit dem unten aufgeführten JScript-Code wird die Applikation gestartet und beendet. Wenn bereits eine Instanz der Applikation ausgeführt wird, so wird diese Instanz aufgerufen.

 

Anmerkung:Für 32-Bit-Versionen von UModel ist der registrierte Name oder programmatische Identifier (ProgId) des COM-Objekts UModel.Application. Für 64-Bit-Versionen von UModel ist der Name UModel_x64.Application.

 

Dieser Code steht in der Beispieldatei ..\UModelExamples\API\JScript\Start.js zur Verfügung (siehe auch Beispieldateien).

 

// 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 {   objUModel = WScript.GetObject("", "UModel.Application");   }
catch(err) {}
 
if( typeof( objUModel ) == "undefined" )
{
  try   {   objUModel = WScript.GetObject("", "UModel_x64.Application")   }
  catch(err)
  {
     WScript.Echo( "Can't access or create UModel.Application" );
     WScript.Quit();
  }
}
 
// if newly started, the application will start without its UI visible. Set it to visible.
objUModel.Visible = true;
 
WScript.Echo(objUModel.Edition + " has successfully started. ");
 
objUModel.Visible = false; // will shutdown application if it has no more COM connections
//objUModel.Visible = true;   // will keep application running with UI visible

© 2017-2023 Altova GmbH