473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Communication between a Windows Service and a UI Front End

JB
Hi All,

I have a VB.NET application that constantly executes queries through
ODBC connections. The application consists of a simple Form type UI
where the query parameters can be edited, and a simple scheduler that
executes the queries.
The application works fine as "standalone" but it now needs to be
installed on a server and left running permanently even when no user
is logged on.
I think a Windows Service would be perfect for this, but I read
everywhere that Windows Services shouldn't have a UI. That makes sense
to me and I'd have no problem splitting the application between a
Front End (form based to edit the parameters) and a back end (doing
the actual execution of the queries).
What I'm wondering now is what would be the simplest way to achieve
this? I've been looking into .NET Remoting (MSDN examples and various
groups), but it seems far too complex for what I need. I need the
split applications to behave just like one single application, they
will always be on the same machine (even same directory), etc.
Can anybody give me any direction on that and/or point me to examples
of Windows Service / UI communication.

Thanks a lot
JB

Aug 26 '07 #1
9 3708
JB wrote:
.... What I'm wondering now is what would be the simplest way to achieve
this?
Can anybody give me any direction on that and/or point me to examples
of Windows Service / UI communication.

Thanks a lot
JB
I have a Service that sits on various Servers. My Service only requires
to function once every 30 mins. Before it performs its task, it checks
a configuration file ("ini" file) which is stored on the local machine.

The ini file can be modified by a separate program which a User launches
when they're logged-in.

This might not suit your requirements, but it might give you an idea of
a way to address your problem.

Regards,

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Aug 26 '07 #2
You could store the values in a database and thus comunicate through the
database with your service ( periodic check intervall ) or
with sql 2005 you could use notification services ( so the service wakes up
when a task is added to the db ) .

And yes Remoting would be suitable , and is not as difficult / complex as
you might think

regards

Michel

"ShaneO" <sp****@optusnet.com.auschreef in bericht
news:46***********************@news.optusnet.com.a u...
JB wrote:
>.... What I'm wondering now is what would be the simplest way to achieve
this?
Can anybody give me any direction on that and/or point me to examples
of Windows Service / UI communication.

Thanks a lot
JB
I have a Service that sits on various Servers. My Service only requires
to function once every 30 mins. Before it performs its task, it checks a
configuration file ("ini" file) which is stored on the local machine.

The ini file can be modified by a separate program which a User launches
when they're logged-in.

This might not suit your requirements, but it might give you an idea of a
way to address your problem.

Regards,

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.

Aug 27 '07 #3
JB
On 27 Aug, 07:28, "Michel Posseth [MCP]" <M...@posseth.comwrote:
You could store the values in a database and thus comunicate through the
database with your service ( periodic check intervall ) or
with sql 2005 you could use notification services ( so the service wakes up
when a task is added to the db ) .

And yes Remoting would be suitable , and is not as difficult / complex as
you might think

regards

Michel

"ShaneO" <spc...@optusnet.com.auschreef in berichtnews:46***********************@news.optusne t.com.au...
JB wrote:
.... What I'm wondering now is what would be the simplest way to achieve
this?
Can anybody give me any direction on that and/or point me to examples
of Windows Service / UI communication.
Thanks a lot
JB
I have a Service that sits on various Servers. My Service only requires
to function once every 30 mins. Before it performs its task, it checks a
configuration file ("ini" file) which is stored on the local machine.
The ini file can be modified by a separate program which a User launches
when they're logged-in.
This might not suit your requirements, but it might give you an idea of a
way to address your problem.
Regards,
ShaneO
There are 10 kinds of people - Those who understand Binary and those who
don't.
Hi All,

Thanks for your suggestions, it helped. I think I will go for an
hybrid solution.
Save an Xml file picked up by the service, and for a UI refresh,
implement a few Remoting function to interogate the service on its
current state.

Regards
JB

Aug 27 '07 #4
ShaneO <sp****@optusnet.com.auwrote in news:46d1f50f$0$11059$afc38c87
@news.optusnet.com.au:
I have a Service that sits on various Servers. My Service only requires
to function once every 30 mins. Before it performs its task, it checks
a configuration file ("ini" file) which is stored on the local machine.

The ini file can be modified by a separate program which a User launches
when they're logged-in.
Wow, yuck - you should really be using remoting!
Aug 27 '07 #5
JB <jb*********@gmail.comwrote in news:1188219529.543145.104720
@r34g2000hsd.googlegroups.com:
Thanks for your suggestions, it helped. I think I will go for an
hybrid solution.
Save an Xml file picked up by the service, and for a UI refresh,
implement a few Remoting function to interogate the service on its
current state.
Why not implement the UI functions as a remoting function too? That'll save
you the hassle of writing out to disk + allow network users to access the
service too!
Aug 27 '07 #6
JB
On 27 Aug, 16:24, Spam Catcher <spamhoney...@rogers.comwrote:
JB <jb.bross...@gmail.comwrote in news:1188219529.543145.104720
@r34g2000hsd.googlegroups.com:
Thanks for your suggestions, it helped. I think I will go for an
hybrid solution.
Save an Xml file picked up by the service, and for a UI refresh,
implement a few Remoting function to interogate the service on its
current state.

Why not implement the UI functions as a remoting function too? That'll save
you the hassle of writing out to disk + allow network users to access the
service too!
Hi Spam Catcher,

You're right, it would certainly be more "elegant" to use remoting for
the whole thing, but the truth is, I'm worried it would require too
much of rewriting to implement. And as I couldn't find any good sample
code out there (other than the basic MSDN one) I'd rather go for
something simpler that I can maybe improve in the future.

Regards
JB

Aug 27 '07 #7
Spam Catcher wrote:
>
Wow, yuck - you should really be using remoting!
I certainly wouldn't agree with using remoting. In this case the
settings are usually only configured during installation and never need
to be changed, however if they ever did, I would argue that using the
method I am using follows the KISS principle and doesn't use
high-falutin' solutions just for the heck of it.

It's funny, Remoting wasn't being used by anyone only a short while ago,
and now every man and his dog seems to be jumping onto the bandwagon!
(I guess that's how fads are created)
ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Aug 27 '07 #8
ShaneO <sp****@optusnet.com.auwrote in news:46d3377c$0$15276$afc38c87
@news.optusnet.com.au:
I certainly wouldn't agree with using remoting. In this case the
settings are usually only configured during installation and never
need
to be changed, however if they ever did, I would argue that using the
method I am using follows the KISS principle and doesn't use
high-falutin' solutions just for the heck of it.
I guess I over-reacted a bit, your method is definately KISS!

I've seen some apps use the registry to pass information back and forth.

.NET's service controller class also has the ability to execute a
custom command and pass in parameter
It's funny, Remoting wasn't being used by anyone only a short while
ago,
and now every man and his dog seems to be jumping onto the bandwagon!
(I guess that's how fads are created)
Remoting has been around since .NET 1.0, which is >5 years old. These
days applications need to be run remotely or on several PCs at once
which mean that some sort of network interface needs to be implemented.
As such .NET remoting is typically the easiest and most robust method
available.

I tend to stay away from data integration methods (i.e. using an INI,
Database, etc) because users could modify the INI file and fudge data. I
always liked the ideas of separate tiers rather than tieing everything
together through a common data layer.

Just my preference I guess :-)

Aug 27 '07 #9
ShaneO wrote:
It's funny, Remoting wasn't being used by anyone only a short while ago,
and now every man and his dog seems to be jumping onto the bandwagon!
I suspect that's largely because we're all having to turn out Windows
Services to get 'round Vista's security .. er .. "enhancements" and
there's no other, easy way of adding a client-process callable API to a
..Net-written Windows Service ...
"he said, earnestly hoping that /someone/ would disagree and suggest
something far, far better" ;-)

Regards,
Phill W.
Aug 28 '07 #10

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

Similar topics

2
by: orion30 | last post by:
All is in the Object. Is-it possible to modify a window from an another window without having a link Parent To Child ? Thank you
4
by: Christian Westerlund | last post by:
Hi! Does anyone know if it is possible for a client server communication easy in .NET with these requirements: The client always initiates the communication The server only answers (responds)...
3
by: Chuck Bowling | last post by:
Ok, I'm not sure this is a C# question but here goes anyhow... I used this walkthru to create a windows service: ...
4
by: Kris | last post by:
I have a Windows Service in C# talking to a serial port and using Remoting. It also uses several COM objects. On customer's computer the service will occassionally hang somewhere - the service...
5
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...
1
by: SL33PY | last post by:
I have a windows service that runs as a system service (so noone has to be logged in for the service to work). A part of the service contains code to export the results in a file. This is where the...
8
by: Mike C# | last post by:
Anyone know of any good articles on how to write a windows service in native (unmanaged) VC++? Also, how to use IPC in the service to communicate with a front-end GUI application would be...
4
by: ags5406 | last post by:
Hi All I have a task that I'm thinking about attacking in two different ways but don't know enough about Windows Services. First: We have a server application written in VB.net that acts as...
9
by: dm3281 | last post by:
Hello -- I plan on writing a C# service using VS2005. If I want my service to have a tray icon, is this typically done from within my service or do/should I create a controller application and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.