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
In VC++, allocated on the heap:
IProgramAPI* pgmAPI = new IProgramAPI;
In VC++, on the stack
Note: before calling CreateDispatch, it is necessary to wake-up COM, as follows:
if( !AfxOleInit() )
AfxMessageBox("COM initialization failed");
Normally, this is placed at the beginning of the InitInstance function in your App class.
In the declarations:
Public pgmAPI As Object
Private pgmAPI As Object
Where needed (e.g. in form load):
Set pgmAPI = CreateObject("SDM.ProgramAPI")
methods fall into four categories: main window control, main menu control,
exchange coordinate system control, and other modifiers.
Main Menu Control
This is a very important topic for developers, as all clients will use the Exchange Coordinate System.