How to get window main handle?

My code is as follows:

#include <Mstn\MdlApi\MdlApi.h>
#include <Mstn\cmdlist.r.h>
#include <Mstn\MdlApi\msnativewindow.h>
#include <windows.h>
#include <DgnPlatform\DgnFile.h>
#include <DgnPlatform\DgnFileIO\DgnFileIOApi.h>

extern "C" DLLEXPORT void MdlMain(int argc, WCharCP argv[])
             HWND hWnd = NULL;
             hWnd = (HWND)mdlNativeWindow_getMainHandle(0);



I can't able to resolve these build errors.

Parents Reply
  • Hi ,

    1. Bmake Compile errors.  Do you have nativewindow.lib in your LINKER_LIBRARIES list in your project mke file?
    2. Visual Studio Compiler Warning (screen capt hilight).
      1. The MicroStation CONNECT SDK developer shell (currently) required Microsoft 8DOT3NAMES to be enabled.  This long standing requirement unfortunately is in direct conflict with Microsoft's IntelliSense current capabilities and is known to cause issues; like your warning and IntelliSense being able to perform: Peek/Go To Definitions/Declarations.  Since it is not likely Microsoft will add support for a legacy requirement like 8DOT3NAMES to IntelliSense, I am working towards:
        1. Updating the developer shell to provide IntelliSense unmangled (full path) names (shooting for next release - U16)
        2. Verify all required tools in our build chain work similarly
        3. Update all SDK Examples to build w/o 8DOT3NAME requirements, and lastly...
        4. Create a wiki on: How to Update Bentley Make Files and Remove 8DOT3NAME Requirements.
      2. Although there is another coding hack/work-around, it is probably best to simply choose to dismiss the IntelliSense compiler warning by:
        1. Go to your Visual Studio Project's - Error List
        2. Change - From: "Build + IntelliSense", To: "Build"