473,473 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to connect to a service?

Hi,

I have a Windows service written in C#
I want to access it from a C# app (or a C++ app for that matter)

How can I do this?

I tried referencing it but it fails telling me the it's not a valid
Assembly or ActiveX (i.e. not a dll)
I can't create an interop dll because that is disabled for services

I can use the Server Browser to start and stop it, but i want to store
and access data in the service and I can't see how

Vin
Jul 21 '05 #1
4 1353
Hi Vincent, take a look at the ServiceController class.

HTH

"Vincent Finn" <1@2.com> wrote in message
news:f7********************************@4ax.com...
Hi,

I have a Windows service written in C#
I want to access it from a C# app (or a C++ app for that matter)

How can I do this?

I tried referencing it but it fails telling me the it's not a valid
Assembly or ActiveX (i.e. not a dll)
I can't create an interop dll because that is disabled for services

I can use the Server Browser to start and stop it, but i want to store
and access data in the service and I can't see how

Vin

Jul 21 '05 #2
On Mon, 6 Dec 2004 15:13:23 -0300, "Felipe Garcia" <#> wrote:
Hi Vincent, take a look at the ServiceController class.


That only allows me to do standard service actions like starting and
stopping

It doesn't give me access to user defined functions.

eg.
The service is monitoring some external systems,
it queries them to see if they are alive and can be used to send
commands to them

I want to have a control app that connects to the service and sends
commands to those systems.
So I want a function in my service called
WriteToScreenServer("ServerName", "Message")

In Com this would be a simple matter of adding a Com interface and
then using it as normal.

I can't see the .Net equivalent

Vin
Jul 21 '05 #3
Elp
On Mon, 06 Dec 2004 17:27:07 +0000, Vincent Finn wrote:
On Mon, 6 Dec 2004 15:13:23 -0300, "Felipe Garcia" <#> wrote: I want to have a control app that connects to the service and sends
commands to those systems.
So I want a function in my service called
WriteToScreenServer("ServerName", "Message")

In Com this would be a simple matter of adding a Com interface and
then using it as normal.

I can't see the .Net equivalent


The .NET equivalent would be .NET Remoting. Expose a .NET Remoting object
from within your windows service and have your client application connect
to it. The client app will then be able to call any of the methods of the
..NET Remoting object. In addition, your windows service will be able to
send events to your client application through this object.

This is of course not the only solution for your problem. You could also
use raw socket communication, pipes... But in your case, it seems that .NET
Remoting would be the easiest solution.
Jul 21 '05 #4
On Mon, 6 Dec 2004 17:57:19 +0000, Elp
<ro********@REMOVEME.hotmail.com> wrote:
On Mon, 06 Dec 2004 17:27:07 +0000, Vincent Finn wrote:
On Mon, 6 Dec 2004 15:13:23 -0300, "Felipe Garcia" <#> wrote:

I want to have a control app that connects to the service and sends
commands to those systems.
So I want a function in my service called
WriteToScreenServer("ServerName", "Message")

In Com this would be a simple matter of adding a Com interface and
then using it as normal.

I can't see the .Net equivalent


The .NET equivalent would be .NET Remoting. Expose a .NET Remoting object
from within your windows service and have your client application connect
to it. The client app will then be able to call any of the methods of the
.NET Remoting object. In addition, your windows service will be able to
send events to your client application through this object.

This is of course not the only solution for your problem. You could also
use raw socket communication, pipes... But in your case, it seems that .NET
Remoting would be the easiest solution.


Thanks, I'll have a read up on that

Vin
Jul 21 '05 #5

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

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
0
by: Brad Clements | last post by:
I'm trying to get a simple service to work with py2exe and python 2.3 I get this error when I start it (after registering it) The description for Event ID ( 240 ) in Source ( UMXWIN32SVC )...
0
by: Jim | last post by:
I'm working on my first .net project using c#. I've been using activex controls embedded in a web page and wanted to do the same in ..net. My approach has been to create a windows control library...
1
by: Mike Stephens | last post by:
I would like to write a service app, a simple application that runs in the background and does its thing, and not necessarily running on the local machine. This service app will not have any GUI...
0
by: Wali Khan | last post by:
HI, I have developed a window service in VB.NET to connect to VSS and some operations are followed. Problem is i am unable to connect to VSS when i install the Service.When i m debugging as an...
0
by: Moe | last post by:
It seems that some recent Microsoft Windows 2000 Service Pack updates has caused the configuration export function in IBM DB2 connect Ver. 7.2 to malfunction by exporting a blank file. The...
0
by: jordo | last post by:
I have an asp.Net app that connects to the WSS 2.0 list web service. I'm having issues with IIS and .Net configurations and hope that someone can help me. My ideal configuration is: asp.net:...
10
by: blurryimage | last post by:
Ok guys I have racked my brain on this one. I have a vb .net service installed on a win2k server. I am trying to get it to connect to sql 2000 box but I get this error: An error has occurred...
3
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found...
1
by: Manjunath.M | last post by:
Hi, I have created a simple Web service with only one function, which takes only one parameter. Below is the function from Web service public string HelloWorld(string input) { return "Hello...
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
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...
1
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,...
1
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...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.