Premise Minibroker subscriptions with a .NET exe

Motorola Premise

123

Senior Member
I am working on an exe app written in vb.net. It is communicating with Premise using the minibroker. It is all working for the most part but I cannot get subscribeToProperty working. I am getting an error thrown on the ObjectContainingCallback parameter, I am not sure what it is looking for. I have tried giving it the form, the class and the connection object, but no luck.

Any ideas?
======================
A few things you should check

If you are using VS.Net 2005 you need to make your assembly "COM Visible". Right click your project in the Solution Explorer and select Properties. Then, press the Assembly Information button. A Dialog should appear that lets you define a bunch of info about your assembly. At the bottom is a checkbox called Make assembly COM-visible. Make sure that's checked.

Make sure your callback function is declared Public.

Make sure the signature on your callback function is correct. I'm using something like this:
Public callbacksub(ByVal subID As Integer, ByVal objChanged As MINIBROKERLib.IRemotePremiseObject, ByVal propChanged As MINIBROKERLib.IRemotePremiseObject, ByVal newValue As Object)

I typically include the callback function in the same class that calls the SubscribeToProperty method. With that in mind, the ObjectContainingCallback parameter is always "Me". So the call should look something like this:
iRet = lclPremiseObject.SubscribeToProperty("LinkMode", "onChangeLinkMode", Me)

I hope this helps.

-John

======================
Thanks Mike! You nailed it on the first one, "COM Visible" did the trick. Thanks!
======================
I hate to admit how many hours it took for me to figure that one out ;)
 
Back
Top