473,387 Members | 1,517 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,387 software developers and data experts.

Window service interface

Hi

How does one return a varible, value, or object from a window service
in .net?

How do I expose the service methods?

A link, code, or anything is wellcome, because I'm going bonkers!

/Erik TL

Nov 22 '05 #1
7 962
You are going to have to be more specific.

A Windows Service is a process (.exe) that is run by the Service Control
Manager. You can not "return" a variable or object from a process
(whether it is a service, or a console application, or a winforms
application).

Where and what do you want to return the data to?
Erik TL wrote:
Hi

How does one return a varible, value, or object from a window service
in .net?

How do I expose the service methods?

A link, code, or anything is wellcome, because I'm going bonkers!

/Erik TL

Nov 22 '05 #2
Well, I have a windows service, that I want to do a Interface to. It
has runtimevalues (shedules in a sealed class), that I need to access.
So I want to return, preferably, an object (arrylist) to the interface.
If that's impossible, then perhaps a string value ...

I can understand the need to isolate the service process as such, but I
have diffuculties understanding the trouble of making disconnected GUI
to check runtime data...

/Erik TL

Nov 22 '05 #3
Remoting is one way to do this (I have used remoting for the exact same setup
as yours). Remoting is a way of doing inter-process calls in .net. Try
doing a search for remoting on MSDN to get started.

Regards, Jakob.
"Erik TL" wrote:
Well, I have a windows service, that I want to do a Interface to. It
has runtimevalues (shedules in a sealed class), that I need to access.
So I want to return, preferably, an object (arrylist) to the interface.
If that's impossible, then perhaps a string value ...

I can understand the need to isolate the service process as such, but I
have diffuculties understanding the trouble of making disconnected GUI
to check runtime data...

/Erik TL

Nov 22 '05 #4
Hi
I've done the return-string-chat mentioned in every example, but I'd
like to
know how i can expose an object from the service or, even better - a
method.
In essence I'd like to be able to return an arraylist from the service
and/or do a method call. If all else fails return a string from inside
the service to a client...

maybe I'm missing something here but I don't really understand
remotingobject (as compared to how you could use windows services
before).

How do i instatiate an object inside the service (as singleton) and use
it in both service and inteface?

/Erik

Nov 22 '05 #5
Hey Erik,

Remoting really does not have anything to do with Windows services but if
you want to call objects in your service process from another (UI) process
then remoting is the way to do it. Remoting is a bit like DCOM (in the "old"
days) only simpler. The remoting architecture supports singletons so it is
ideal for calling objects living within a service. It even lets you use
events so that the service can notify the UI of any changes (this is a bit
tricky though but it can be done).

Of course, there are other more simple ways of communicating between a
service and a corresponding user interface. E.g. you can let the service
create files in a well-known folder and then have the UI process read these
files (and the other way around) but you might run into synchronization
problems.

If you want I can try making a small sample project for you - in that case
just send me an e-mail.

Regards, Jakob.
"Erik TL" wrote:
Hi
I've done the return-string-chat mentioned in every example, but I'd
like to
know how i can expose an object from the service or, even better - a
method.
In essence I'd like to be able to return an arraylist from the service
and/or do a method call. If all else fails return a string from inside
the service to a client...

maybe I'm missing something here but I don't really understand
remotingobject (as compared to how you could use windows services
before).

How do i instatiate an object inside the service (as singleton) and use
it in both service and inteface?

/Erik

Nov 22 '05 #6
Hi,

Sen you a mail, I hope you got it...and once again thanks for the offer
- I accept it humbly.

Kind Regards
/Erik TL

Nov 22 '05 #7
Hi Erik,

I got you e-mail and I have put together a small sample for you. I hope it
will get you started :-)

Regards, Jakob.
"Erik TL" wrote:
Hi,

Sen you a mail, I hope you got it...and once again thanks for the offer
- I accept it humbly.

Kind Regards
/Erik TL

Nov 22 '05 #8

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

Similar topics

7
by: Erik TL | last post by:
Hi How does one return a varible, value, or object from a window service in .net? How do I expose the service methods? A link, code, or anything is wellcome, because I'm going bonkers! ...
18
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a...
2
by: PatrickSA | last post by:
Hi, Am new to web services, so apologies for the basic nature of the question - and apologies in advance if this is the wrong newsgroup. We're building a new web service and I'm looking around...
1
by: Julia | last post by:
My service send email messages and log all information to a log file I wonder if it's common to raise events from the service(the remote object which hosted inside the service) to my MMC snapin,...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
4
by: WinDev | last post by:
We are trying to build a system where we have a Windows Service do some manipulation of data, and then sending the data to a Windows App. I had posted a question of how we should do this and was...
6
by: dotNeter | last post by:
The services, talked here, are things used in IServiceContainer, IServiceProvider, etc. In my opinion, everything can be a service, and a service is generally used for providing specific features...
1
by: wolfenstein | last post by:
Hi, I'm working on a window service and i want to give an interface to it. What can be the best approach to get this done. Can i include a Form, when the user starts the service then gives some...
4
by: =?Utf-8?B?am9obmY=?= | last post by:
Trying to get a see windows messages using IMessageFilter interface however it does not seem to get all window messages. Specifically I am looking for the WM_POWERBROADCAST. I override wndproc...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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...

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.