Send Message to Windows Service

  • Thread starter Ahmad Jalil Qarshi
  • Start date
A

Ahmad Jalil Qarshi

Hi!

I want to develop two applications one a Windows Service and the other a GUI
based application. I want some sort of communication between Service and
GUI. I have decided to use Remoting for this purpose.

For this I registered an object on Service side for Remoting purposes.
Remote Object exposes a function named ReloadFiles() that should internally
send a message to service class to Reload some files. Now I don't know how
to send message to that service class because Remote Object doesn't have a
reference to service.

Anybody there to give me a helping hand.


Thanks in advance.

Ahmad Jalil Qarshi
 
R

Richard Blewett [DevelopMentor]

Ahmad Jalil Qarshi said:
Hi!

I want to develop two applications one a Windows Service and the other a
GUI based application. I want some sort of communication between Service
and GUI. I have decided to use Remoting for this purpose.

For this I registered an object on Service side for Remoting purposes.
Remote Object exposes a function named ReloadFiles() that should
internally send a message to service class to Reload some files. Now I
don't know how to send message to that service class because Remote Object
doesn't have a reference to service.

Anybody there to give me a helping hand.


Thanks in advance.

Ahmad Jalil Qarshi

They need to share some concept of type information to be able to pass the
message.

Make the remoted object implement and interface, and have that interface
declared in a separate DLL.

Now make the UI reference the DLL and it can use (assming the interface is
called IFoo)

IFoo f = (IFoo)RemotingServices.Connect(typeof(IFoo), myUrl);

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
 
R

Richard Blewett [DevelopMentor]

R

Richard Blewett [DevelopMentor]

Josip Habjan said:
"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:[email protected]...
Of course the .NET 2.0 remoting IPC channel uses named pipes

Regards

Richard Blewett - Developmentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk


Yes, it is true, but in framework 1.1 you dont have IPC channels or named
pipes....

Regards,
Josip Habjan

Agreed,

but I just thought it was worth pointing out that if he was using v2.0 there
was a solution built into the framework without him having to buy your
component

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
 
A

Ahmad Jalil Qarshi

Thanks Josip & Richard

Since I have .NET 1.1 so I would like to use option provided by Richard
Blewett.

Thanks again.

Ahmad Jalil Qarshi

Josip Habjan said:
"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:[email protected]...
Agreed,

but I just thought it was worth pointing out that if he was using v2.0
there was a solution built into the framework without him having to buy
your component

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

No problem :blush:)

Regards,
Josip Habjan
 

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