471,319 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Send Message to Windows Service

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
Jan 2 '06 #1
7 13659
"Ahmad Jalil Qarshi" <ah*********@SPAMhotmail.com> wrote in message
news:eu*************@TK2MSFTNGP09.phx.gbl...
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
Jan 2 '06 #2
Hi,

This will work with remoting, but i think it is little uncouthly...

Did you thinked about Interprocess communication or shared memory or shared
events .. ?
See: http://www.habjansoftware.com/ipc_library.aspx

Regards,
Josip Habjan

"Ahmad Jalil Qarshi" <ah*********@SPAMhotmail.com> wrote in message
news:eu*************@TK2MSFTNGP09.phx.gbl...
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

Jan 2 '06 #3
"Josip Habjan" <jh*****@SPAM-OFF.net.hr> wrote in message
news:dp**********@ss405.t-com.hr...
Hi,

This will work with remoting, but i think it is little uncouthly...

Did you thinked about Interprocess communication or shared memory or
shared events .. ?
See: http://www.habjansoftware.com/ipc_library.aspx

Regards,
Josip Habjan

"Ahmad Jalil Qarshi" <ah*********@SPAMhotmail.com> wrote in message
news:eu*************@TK2MSFTNGP09.phx.gbl...
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



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
Jan 2 '06 #4
"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:u9**************@tk2msftngp13.phx.gbl...

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
Jan 2 '06 #5
"Josip Habjan" <jh*****@spamoff-net.hr> wrote in message
news:dp**********@magcargo.vodatel.hr...
"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:u9**************@tk2msftngp13.phx.gbl...

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
Jan 3 '06 #6
"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:eW**************@TK2MSFTNGP14.phx.gbl...

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 :o)

Regards,
Josip Habjan
Jan 3 '06 #7
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" <jh*****@SPAM-OFF.net.hr> wrote in message
news:dp**********@ss405.t-com.hr...
"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:eW**************@TK2MSFTNGP14.phx.gbl...

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 :o)

Regards,
Josip Habjan

Jan 3 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by robboll | last post: by
1 post views Thread by mmassari | last post: by
5 posts views Thread by tommaso.gastaldi | last post: by
1 post views Thread by Vijay | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.