473,658 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jul 21 '05 #1
7 1254
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

Jul 21 '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

Jul 21 '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

Jul 21 '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

Jul 21 '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

Jul 21 '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

Jul 21 '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

Jul 21 '05 #8

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

Similar topics

18
2486
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 statusbar. Yet FF gives me both a statusbar and the window is resizable! Does this mean that FF does not support these "features" or is there a different way to code them for FF?
2
528
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 for documentation on a number of issues, including versioning of web service interfaces... I've spent the last few hours looking through books, Google, MSDN and surprisingly I have found little or nothing that explains/shows how to practically...
1
1450
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, so user will be able to see (roughly) what the service is doing I am thinking about something similar to COM+ snap in "Transactions statistics" node
7
970
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! /Erik TL
4
3991
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 told remoting was the way to go. So I got a client and a server program up and going and from the client I can call a routine in the server program. I can't figure out how to actually send data to the client. At the moment the client calls a...
6
1916
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 for service consumers, at design time. But, I think the cnsumers must completely know all aspects of that service. This sounds not good, and breaks the decoupling rule. So how to understand the role of Service, in a software engineering...
1
885
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 parameters only on the start. then the service is started and continue its work. No need to give values on run-time. Looking for best approaches.....................
4
3754
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 which shows the msg successfully but nothing shows up when using IMessageFilter. Am i misunderstanding something? Here is sample code: public class MyFilter : IMessageFilter { const int WM_POWERBROADCAST = 0x0218; public bool...
0
8427
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
8330
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,...
1
8523
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
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
7355
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
6178
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
5649
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();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1737
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.