Premise Minibroker on 64 bit windows

Motorola Premise
Sometimes when you get away from something long enough and come back to it, you can look at it with a very fresh perspective.  Well, that's what happened with minibroker working on 64 bit windows.  I got it to work on (at least) Windows 8.1 and Windows Server 2012 R2.  I haven't tested it on other versions.  To make it work you need to ensure the DEP is ONLY enabled for "Essentials Windows Programs and Services ONLY.  You can do this by right clicking on the Computer icon, select Properties, click on the Advanced tab, and then on the Data Execution Prevention Tab.  You'll see two radio buttons.  Pick the top one.
 
Then, in Visual Studio, look at your Project's properties. 
  • Under the "Application" tab, click on Assembly Information and make sure that the "Make Assembly COM visible" check box is CHECKED
  • Under the "Compile" tab make sure you are targeting only x86 CPU's. That's because minibroker.dll is a 32 bit COM object ONLY.
  • On the same tab, click on the "Build Events" button and add two Post-build event commands similar to this.  You will need to adjust the path for your version of Visual Studio.  This one is for VS 2013
  • On your target machine, don't forget to register minibroker.dll with with COM.  The Premise installer automatically does that for you.

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO $(TargetPath)

 
The previous steps were documented in other posts, but minibroker apps simply didn't work.  Property subscriptions would fail to fire their handlers. No errors, it just didn't fire the handlers.  After doing some digging on how VTABLES work in 32 versus 64 bit Windows, I found  the answer.  The "revelation" that made it work was in the "Debug" tab.    Make sure that in the "Enable Debuggers" section you CHECK the "Enable native code debugging" and the "Enable the Visual Studio hosting process" check boxes. 
 
I hope this helps someone.  It literally took years to figure this out.
 
Back
Top