How do you create a windows service property sheet?

  • Thread starter Thread starter PJ Olson
  • Start date Start date
P

PJ Olson

In C++ we had the ability to create a property page that could be merged
into an existing property sheet to provide customization inputs for users.
Can anyone point me to an example of how to do this in C#? I am creating a
windows service which has dynamic parameters that the user can change.
Instead of creating an administration application I would like to include
the parameters in a property page and have it merged with the default
property sheet provided by the windows service control manager. Microsoft
does this same sort of thing (probably using MFC) with their SNMP service in
XP. If you look at the properties of this service you will see extra tabbed
pages that contain configuration params that the user can change. This is
exactly what I am trying to accomplish in C#.

Any help or guidance would be greatly appreciated!

Thanks,
PJ
 
I hate to say it, but it's almost not worth it.
You can use Interop attributes to recreate the COM property page interfaces
and implement them (there's no pre-compiled TLB that i know of). The
interfaces themselves aren't that bad - i've done this before, both in
VB(5/6) and .NET, however, windows is expecting to see a dialog resource...
and you aren't going to have fun providing that in C#.

My suggestion is to create a seperate GUI and use the ServiceController
class to manipulate your service, or use the ServiceController class in
conjunction with the MMC classes to create an MMC snap-in.

If you "REALLY" have to provide that property page, then I suggest using
MC++ instead.

-Rob Teixeira [MVP]
 
I was afraid of that. I think I will take your advice and create my own GUI.

Thanks,
PJ
 
Back
Top