123
Senior Member
Here's a tough question for Damon and/or John!
What's the trick for making a Windows Service using Minibroker (in C#)? The SubscribeToProperty method works fine in a Windows Form application but fails in a Windows Service. The method takes three parameters:
The third parameter, ObjectContainingCallback, is usually set to "this" and works in a Windows Form. However, in a Windows Service, it throws the following exception:
This type has a ComVisible(false) parent in its hierarchy, therefore QueryInterface calls for IDispatch or class interfaces are disallowed.
I have added the following NameSpace:
using System.Runtime.InteropServices
and decorated all classes with:
[ComVisible(true)]
Again, this works in a Windows Form but fails in a Windows Service. What do I need to do to get it to work for a Service?
What's the trick for making a Windows Service using Minibroker (in C#)? The SubscribeToProperty method works fine in a Windows Form application but fails in a Windows Service. The method takes three parameters:
- string PropertyName
- string NameOfCallbackFunction
- object ObjectContainingCallback
The third parameter, ObjectContainingCallback, is usually set to "this" and works in a Windows Form. However, in a Windows Service, it throws the following exception:
This type has a ComVisible(false) parent in its hierarchy, therefore QueryInterface calls for IDispatch or class interfaces are disallowed.
I have added the following NameSpace:
using System.Runtime.InteropServices
and decorated all classes with:
[ComVisible(true)]
Again, this works in a Windows Form but fails in a Windows Service. What do I need to do to get it to work for a Service?