Hello all,
Im writing a Windows service that will act as a Central for a system. Applications needs to be able to make calls to the Central Service by setting/getting data
I followed this tutorial that I thought would do the job.
http://msdn.microsoft.com/library/de...et11272001.asp
But this is what happens:
Now the problem is that the information App1 changes in the remote object App2 and App3 can not get or see. What I'd like to see is information that any of the Applications put in the others can also see/get/set.Code:____________________________ | Windows Service | App1-----| | Hosting Remote Obj | | ____________ |----RemoteObjApp1 | | | | | | App2-----|------>| Remote Obj |--|----RemoteObjApp2 | | |____________| | | | | |----RemoteObjApp3 | App3-----| |____________________________|
For a simple example of how I'd like it to work. The Service holds a string. Via the Remote object I would like to set this string.
Example:
Application 1
App1.RemoteObj.SetServiceString("Hello from 1")
Application 2
Console.WriteLine(App2.RemoteObj.GetServiceString()) 'Returns "Hello From 1"
App2.RemoteObj.SetServiceString("Hello from 2")
Application 3
Dim str as String
str = App3.RemoteObj.GetServiceString ' Returns "Hello from 2"
This is how I want it to be:
I been looking for days for a tutorial that shows how you can in VB.NET make a windows service that you can interact with through multiple clients and share the data globaly between the clients.Code:_____________________________________ | Windows Service | App1-----| | Hosting Remote Obj | | ____________ |-RemoteObjApp1\ | | | | | \ | App2-----|------>| Remote Obj |--|-RemoteObjApp2---CentralObj| | |____________| | / | | | |-RemoteObjApp3/ | App3-----| |_____________________________________|
If VB.NET supported Global objects then I could get the global object in the Remote Object constructor. But I dont know how to do this since the Windows Service is one Project(creating the Exe) and the other project is the remote object class library(creating a DLL).
There seem to be no way of adding a reference from the Windows Service to the Remote Object since Refs needs to be DLLs and Windows Service is an Exe.
If anyone know how to do this please help. This is doing my head in.
Best Wishes,
Farek




Reply With Quote