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.
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.
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
Did you know that you can enjoy many members-only features simply by quickly registering (no CAPTCHA!)?
Registering gives you access to our giveaways, forum features, increased search performance, access to our Download Library, create your own blog & gallery, and more!
Once you have registered, stop by in 'Hello World', and introduce yourself.
Minibroker subscriptions with a .NET exe
No replies to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users