The MicroStation Development Library (MDL) and MicroStationAPI provide APIs for developers wanting to create custom applications for MicroStation® from Bentley Systems. We create a MicroStation application as a DLL, written using C++ and built with the Microsoft C++ compiler and linker provided with Visual Studio.
When editing your source code, you can choose whether to use Microsoft Visual Studio, Microsoft Visual Studio Code, or one of your favourite text editors.
When building your app, you can use Visual Studio or the Bentley Systems make (bmake) tools.
All that we discuss here concerns MicroStation dialogs that are part of your C++ application. If your app. doesn't use MicroStation dialogs then this article is of no concern to you. For example, if your app. uses Microsoft Foundation Class (MFC) dialogs, Windows Forms or some other Microsoft technology then you can safely ignore all that follows.
For over two decades, MicroStation has provided its own dialog and other user interface devices. It provides an elegant mechanism to exchange data between your program variables and the widgets that display variable data.
The Dialog Manager is responsible for managing the exchange of data. In order to achieve that data exchange, you need to add one or two files and pieces of code to your MicroStation application …
*.r
) file
main()
or MdlMain()
function should publish your
variable name(s) & address(es) using one of the mdlDialog_publishXxx()
functions
Any but the simplest application has several variables whose values are shown in the user interface.
It's convenient to package your variables in a C-style struct
.
The struct
should declare only variables.
It should not include any methods — this is a C-struct not a C++ class definition.
Your struct
definition belongs in a header file that is visible to the C++ compiler and to
MicroStation's resource compilers.
In order for the Dialog Manager to know about your variables you must publish them.
mdlDialog_publishXxx()
is usually invoked in your app's main()
.
*.mt
) File
The Dialog Manager must know about the data types and structure of your published variables.
The type resource file (*.mt
) is succinct and
usually contains a single publishStructures
operator.
MicroStation's type resource compiler analyses your type (*.mt
) file and creates a binary resource file.
The binary resource file contains type definitions that can be interpreted by the Dialog Manager.
All the above describe, in outline, code and definitions that you write for your MicroStationapplication. They have nothing to do with Microsoft or Viz Studio. If you inject anything about MicroStation's Dialog Manager or type files into a Viz Studio project then it will complain.
When you build your project using bmake, your type (*.mt
) file should be compiled automatically to a type resource and linked with your other MicroStation resources.
If you prefer a Viz Studio project, then you nonetheless must build those parts of your project that Viz Studio
does not understand using bmake.
Post questions about C++ and the MicroStationAPI to the MicroStation Programming Forum.