MicroStationAPI: Type Resource Files

  • All Publications
  • CONNECT Publications
  • Links
  • WishList
  • LA Solutions
  • Home
LA Solutions
tel: +44 1398 361 800

Introduction

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.

MicroStation Dialogs

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.

MicroStation Dialog Manager

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 …

  • Dialog box and other user interface definitions in a resource (*.r) file
  • A header file that defines a C-style struct of variables used in your dialogs
  • A type resource file that is used by the Dialog Manager to interpret your variable structure
  • Your main() or MdlMain() function should publish your variable name(s) & address(es) using one of the mdlDialog_publishXxx() functions

Application Struct Definitions

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.

Publish Application Variables

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().

MicroStation Type (*.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 Type Resource Compiler

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.

Visual Studio is not Involved

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.

Questions

Post questions about C++ and the MicroStationAPI to the MicroStation Programming Forum.


Trademarks

All trademarks are acknowledged. Trademarks may be registered in some jurisdictions.

Home
Home
Updated on 02-Mar-2025 Copyright © 2016…2025 Jon Summers