PC Review


Reply
Thread Tools Rate Thread

Communicating windows service with windows app: remoting?

 
 
Diego F.
Guest
Posts: n/a
 
      8th May 2007
Hello. I have a windows service running that listens to a port and makes
insert queries in a database.

I need to make an interface, so my idea is creating a simple windows
application that just shows messages from the service.

Can I do that with remoting? What are the main steps to do that?

--

Regards,

Diego F.



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hha3JhdmFydGh5?=
Guest
Posts: n/a
 
      8th May 2007
One way i can recommend is while the windows service is processing, let it
write onto event viewer. So that you can use the windows app to read the
messages from Event viewer on a perioding intervels.

HTH
--
Every thing is perfect, as long as you share!!!

Don''t forget to rate the post


"Diego F." wrote:

> Hello. I have a windows service running that listens to a port and makes
> insert queries in a database.
>
> I need to make an interface, so my idea is creating a simple windows
> application that just shows messages from the service.
>
> Can I do that with remoting? What are the main steps to do that?
>
> --
>
> Regards,
>
> Diego F.
>
>
>
>

 
Reply With Quote
 
John Timney \(MVP\)
Guest
Posts: n/a
 
      8th May 2007
If you already have it listenting to one port, why not just have it listen
to another on a different thread and have your interface communicate with it
through sockets.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog



"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello. I have a windows service running that listens to a port and makes
> insert queries in a database.
>
> I need to make an interface, so my idea is creating a simple windows
> application that just shows messages from the service.
>
> Can I do that with remoting? What are the main steps to do that?
>
> --
>
> Regards,
>
> Diego F.
>
>
>



 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      8th May 2007
"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello. I have a windows service running that listens to a port and makes
> insert queries in a database.
>
> I need to make an interface, so my idea is creating a simple windows
> application that just shows messages from the service.
>
> Can I do that with remoting? What are the main steps to do that?


Sure you can, and you can also use WCF (V3 of the Framework).
When using local cross-process remoting, your best bet is to use the
"IpcServerChannel".
Implement the "server side" in your Windows application and make sure it
runs on a thread separated from the UI thread, keep in mind to marshal the
calls when updating the UI. Your Service simply acts as a remoting client.
Search MSDN, it sure contains some simple samples to give you an head start.

Willy.

 
Reply With Quote
 
Diego F.
Guest
Posts: n/a
 
      8th May 2007

"Chakravarthy" <(E-Mail Removed)> wrote in message
news:8A86EAB5-DD70-41D5-9BFE-(E-Mail Removed)...
> One way i can recommend is while the windows service is processing, let it
> write onto event viewer. So that you can use the windows app to read the
> messages from Event viewer on a perioding intervels.
>


That looks easy. I can try that. Thank you for your idea. The only issue is
that won't be in real time.

--

Regards,

Diego F.



 
Reply With Quote
 
Diego F.
Guest
Posts: n/a
 
      8th May 2007

"Willy Denoyette [MVP]" <(E-Mail Removed)> wrote in message
news:6654EB57-0389-4488-88F1-(E-Mail Removed)...
> "Diego F." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello. I have a windows service running that listens to a port and makes
>> insert queries in a database.
>>
>> I need to make an interface, so my idea is creating a simple windows
>> application that just shows messages from the service.
>>
>> Can I do that with remoting? What are the main steps to do that?

>
> Sure you can, and you can also use WCF (V3 of the Framework).
> When using local cross-process remoting, your best bet is to use the
> "IpcServerChannel".
> Implement the "server side" in your Windows application and make sure it
> runs on a thread separated from the UI thread, keep in mind to marshal the
> calls when updating the UI. Your Service simply acts as a remoting client.
> Search MSDN, it sure contains some simple samples to give you an head
> start.
>
> Willy.
>


Then, just to identify the scenario, according to the MSDN help I need:

A remotable object.
A host application domain to listen for requests for that object.
A client application domain that makes requests for that object.

You suggest that the client is the service and the host is the windows app.
Which is the remotable object?

--

Regards,

Diego F.




 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      8th May 2007
"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Willy Denoyette [MVP]" <(E-Mail Removed)> wrote in message
> news:6654EB57-0389-4488-88F1-(E-Mail Removed)...
>> "Diego F." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hello. I have a windows service running that listens to a port and makes
>>> insert queries in a database.
>>>
>>> I need to make an interface, so my idea is creating a simple windows
>>> application that just shows messages from the service.
>>>
>>> Can I do that with remoting? What are the main steps to do that?

>>
>> Sure you can, and you can also use WCF (V3 of the Framework).
>> When using local cross-process remoting, your best bet is to use the
>> "IpcServerChannel".
>> Implement the "server side" in your Windows application and make sure it
>> runs on a thread separated from the UI thread, keep in mind to marshal
>> the calls when updating the UI. Your Service simply acts as a remoting
>> client.
>> Search MSDN, it sure contains some simple samples to give you an head
>> start.
>>
>> Willy.
>>

>
> Then, just to identify the scenario, according to the MSDN help I need:
>
> A remotable object.
> A host application domain to listen for requests for that object.
> A client application domain that makes requests for that object.
>
> You suggest that the client is the service and the host is the windows
> app.
> Which is the remotable object?
>
> --
>
> Regards,
>
> Diego F.
>
>
>
>



The "remotable object", is the object you want to pass from the client to
the server, for instance the service state information (what you called
"messages from the service") you want to pass from your service to the
Windows application. This object must derive from MarshalByRefObject and
implement a common interface.

Willy.




 
Reply With Quote
 
Mr. Arnold
Guest
Posts: n/a
 
      8th May 2007

"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello. I have a windows service running that listens to a port and makes
> insert queries in a database.
>
> I need to make an interface, so my idea is creating a simple windows
> application that just shows messages from the service.
>
> Can I do that with remoting? What are the main steps to do that?
>


Why don't you look up how to do a Service OnCustomCommand event, which can
be done from a Windows Desktop application that's communicating with the
service?

The OnCustomCommand event gathers your messages from the service, which
could be held in an array, writes the data to a text file in a directory,
the Windows Desktop application, detects this file's presence and displays
the data in a Listbox.




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Service communicating with Browser Windows? =?Utf-8?B?VG9tIFllZQ==?= Microsoft VC .NET 1 16th Sep 2006 09:08 PM
Communicating with a Windows Service from a Windows Application Mike Microsoft C# .NET 1 20th Aug 2004 07:27 PM
Communicating with a windows service DotNetJunkies User Microsoft Dot NET Framework 1 2nd Aug 2004 10:29 AM
Communicating with a Windows Service =?Utf-8?B?a2V0dGNo?= Microsoft Dot NET Framework 6 19th Jul 2004 03:03 PM
Communicating with a Windows Service =?Utf-8?B?V2lsbWE=?= Microsoft Dot NET Framework 8 14th Jun 2004 11:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:49 PM.