473,769 Members | 4,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Communicating windows service with windows app: remoting?

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.

May 8 '07 #1
7 2281
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.

May 8 '07 #2
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." <di********@msn .comwrote in message
news:eQ******** ******@TK2MSFTN GP04.phx.gbl...
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.

May 8 '07 #3
"Diego F." <di********@msn .comwrote in message
news:eQ******** ******@TK2MSFTN GP04.phx.gbl...
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
"IpcServerChann el".
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.

May 8 '07 #4

"Chakravart hy" <ds******@india .comwrote in message
news:8A******** *************** ***********@mic rosoft.com...
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.

May 8 '07 #5

"Willy Denoyette [MVP]" <wi************ *@telenet.bewro te in message
news:66******** *************** ***********@mic rosoft.com...
"Diego F." <di********@msn .comwrote in message
news:eQ******** ******@TK2MSFTN GP04.phx.gbl...
>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
"IpcServerChann el".
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.


May 8 '07 #6
"Diego F." <di********@msn .comwrote in message
news:uj******** *****@TK2MSFTNG P02.phx.gbl...
>
"Willy Denoyette [MVP]" <wi************ *@telenet.bewro te in message
news:66******** *************** ***********@mic rosoft.com...
>"Diego F." <di********@msn .comwrote in message
news:eQ******* *******@TK2MSFT NGP04.phx.gbl.. .
>>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
"IpcServerChan nel".
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 MarshalByRefObj ect and
implement a common interface.

Willy.


May 8 '07 #7

"Diego F." <di********@msn .comwrote in message
news:eQ******** ******@TK2MSFTN GP04.phx.gbl...
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.


May 8 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2299
by: Dennis Stew | last post by:
How do I access Public variables within a Windows Service? I can, and have, created installed and executed a basic Service. From my client App I can Start, Stop...etc the service.... What I want to do is to read properties that are in the service. for instance if the service had a Propertie or Public variable like Public Int Myint = 12; (or... Public Myint as integer = 12)
2
7278
by: Fadi | last post by:
Backround: I am trying to figure out how to do the equivalant of a classic COM Local Server Singleton in .NET/C#. I created a coupld of simple Class Libs that exposes public interfaces and hosted them in a Windows Forms EXE. Create a Windows Forms client and both the Client and the Host EXEs configure the remoting protocols through respective .config files. Problem: I want to change the host from an Win Forms EXE to a Windows Service.
0
932
by: Tappy Tibbons | last post by:
We are trying to write a simple GUI front end to communicate with a service. We need the GUI to make the service fire certain events if the user needs to re-perform certain tasks manually, and possibly return a result string with back to the user from what the service did, records processed, errors, etc. We are thinking there should be a system tray icon as well that the user uses to open the GUI as needed. We tried to keep it...
5
8475
by: Brian Patrick | last post by:
I have an application model which will consist of a front-end configuration application, which needs to control the state of a back-end vb.net windows service (which is the component that does all the work). Think of this in the same manner as say microsoft management console and the w3svc (inetinfo) service. What should the standard communication protocol be between the configuration app and the service in this model? For example,...
17
6442
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
2
6898
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app (which is the UI used to adjust the actions taken by, and the schedule of the service), then a privileged user thread should be used in the UI - no service required. But... "A windows service enables the creation of long-running executable
7
3090
by: deko | last post by:
I'm trying to finalize a windows service design any would appreciate any comments - I'm new to windows services. Essentially my UI app relies on a service to schedule IO tasks. The service does nothing but keep track of elapsed time. The reason I need a service is because the IO tasks are login agnostic. It doesn't matter if anyone, or no one, is logged in. The IO tasks are defined in the UI.
0
1130
by: Jason | last post by:
Ok, for the life of me, I just don't understand what's going on. I want to use remoting to send messages from a windows service to a windows form app, but I just can't get it to work. So, here's what I have so far. I created a small, remotable object that inherits from MarshalByRefObject. It has a public subroutine that raises an event with a message attached: Public Delegate Sub TestServiceEventHandler(ByVal Message As String) ...
14
5624
by: Peter | last post by:
..NET 3.5 I have a Windows Service application and it does remoting, but when a client incounters an error the client get the following error message "Server encountered an internal error. For more information, turn off customErrors in the server's .config file." Where do I turn this off
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10050
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.