Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [CONNECT C++] How do you get an MSWindowP to the main CONNECT application window?

$
0
0

C++ Wrapper for mdlNativeWindow_api

In the absence of a MicroStationAPI NativeWindow class, you can write your own wrapper class to help in this situation. Put the initialiser in your class construction, then add methods that wrap the MDL functions you need. In this example …

struct MdlNativeWindowWrapper
{
    MdlNativeWindowWrapper () { mdlNativeWindow_initialize ("unused"); }
    HWND GetMainHandle (int screen = 0) { return mdlNativeWindow_getMainHandle (screen);  }
};

Usage …

MdlNativeWindowWrapper wrapper;
HWND mainWindow = wrapper.GetMainHandle ();

Using your wrapper rather than the raw MDL functions means that you can't forget to initialise. You probably recognise this as an implementation of RAII.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>