Connecting to Simulator Automation Server

Concept Link IconSee Also

 

Once the Type Library or COM functions have been included in your programming environment, the Simulator Automation Server can be handled as any other object in your code. The method for assigning and connecting to the Simulator Automation Server can vary depending on the programming environment used, but the idea is basically the same. You define a variable in your program to point to the server object, which is called SimulatorAuto. If the Type Library was imported properly, you should have full access to the SimulatorAuto object and its defined functions. Again, the procedure for creating the object and connecting to SimulatorAuto may vary for different programming languages. Check the help for your programming environment on connecting to COM or Automation servers.

 

Examples

The following examples are just a few specific examples for certain programming media. The procedure may be different for other programming media not listed. In addition, a procedure given for a certain type of programming media may be one variation from several possible procedures for accomplishing the same task.

Borland Delphi 5

Microsoft Visual Basic for Applications

Early Binding:

Dim A as New pwrworld.SimulatorAuto

Late Binding:

Set A = CreateObject("pwrworld.SimulatorAuto")

Both Early and Late Binding:

Microsoft .NET

Marshal.FinalReleaseComObject(A)

Set A = Nothing

Microsoft Visual C++

hr = CLSIDFromProgID(L"pwrworld.SimulatorAuto", &clsid)

hr = A>CreateInstance(clsid, NULL, CLSCTX_SERVER)

hr = A>Release()

 

Python

import win32com.client

object = win32com.client.Dispatch("pwrworld.SimulatorAuto")

del object

object = None

 

Matlab v.6.5 r.13

A = actxserver(‘pwrworld.SimulatorAuto’)