Premise C# SubscribeToProperty - VS2013 - "System.InvalidCastException was unhandled"

Motorola Premise

nigelbe

New Member
using Premise; // ****** Must Target X86 ******

ISYSMiniBroker miniBroker = new SYSMiniBrokerClass();
IRemotePremiseObject root = null;
.
.
x = root.GetObject("sys://Home/Outside/Light Sensor");
x.SubscribeToProperty("DisplayName","updater1",this);


Reading the forum I'm sort-of starting to believe that this will no longer work.
 
I'm working on a MQTT to premise bridge and I have all the other bit's working using Mosquitto and peripherals over WiFi to ESP8266 microcontrollers. I'm stuck on getting changes in SYS to publish.
 
If it won't work, I'll go to my next best option using some sort of TCP/IP but it seems awkward.
 
Thanks for looking.
 
All the best ...
                      Nigel.
 
Hi Nigel,

This does work. I use it all the time. Which statement is throwing the exception? I assume you are successfully connecting to premise, but if not you may get weird behavior. You also need to do some tweaking to the executable to disable DEP (there's a post on doing that), and adjust the debugger's behavior. I'm sitting on a soccer field right now without access to my system, but I'm pretty sure I posted a detailed description on getting minibroker working on the newer 64 bit OS's. You may want to search for posts by me about minibroker. I can tell you, it was very painful plodding through disassembled code figuring out why it was failing.
 
Hi,
 
Thanks for your help.
I've struggled on with no success using VS2013 so I installed VS2005 on another machine and now it works :D
 
All the best ...
                      Nigel.
 
Back
Top