Obtaining Access

This is the SDM's top-level API object.  It is accessed through the registry.  The code snippets below show how it is done in Visual C++ and Visual Basic.

In VC++, allocated on the heap:

  1. IProgramAPI* pgmAPI = new IProgramAPI;

  2. pgmAPI->CreateDispatch( "SDM.ProgramAPI");

In VC++, on the stack

  1. IProgramAPI pgmAPI;

  2. pgmAPI.CreateDispatch( "SDM.ProgramAPI");

Note: before calling CreateDispatch, it is necessary to wake-up COM, as follows:

if( !AfxOleInit() )
    AfxMessageBox("COM initialization failed");
    return FALSE;

Normally, this is placed at the beginning of the InitInstance function in your App class.

In VB:

In the declarations:

Public pgmAPI As Object


Private pgmAPI As Object

Where needed (e.g. in form load):

Set pgmAPI = CreateObject("SDM.ProgramAPI")





These methods fall into four categories: main window control, main menu control, exchange coordinate system control, and other modifiers.

Main Window Control

  Main Menu Control

 Exchange Coordinate System Control

This is a very important topic for developers, as all clients will use the Exchange Coordinate System.  

Other Modifiers


Access Methods