Communicating with a Windows Service from a Windows Application

M

Mike

I have written a windows service that has a few methods which have a
return type of dataset. I also have an application that I have
written which I would like to 'hook' into my service and use the
dataset functions I have developed. My service and application are two
seperate projects under the same solution. My problem comes in when
I try to 'hook' into the service and call anything from it.

I have tried using the ExecuteCommand method in ServiceProcess but it
has a return type of void and only allows me to pass a numeric
parameter. I can get past the numeric paramter part but I need to be
able to return a dataset from the service to my application.

Bottom line... I would like to have a service that allows me to
consume the data it holds instead of hitting the datasource that the
data originally was pulled from by the service. (One way in, one way
out)

Any information, or ideas, on how to handle this process would be
greatly appreciated.

Thanks for your help.

(If you need more detail, please let me know.)
 
N

Nicholas Paldino [.NET/C# MVP]

Mike,

Basically, in order to do this, you will have to have your service
expose an object through remoting. Then, you can get a proxy to the object
in the service process and execute methods in that process.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top