I succesfully did some remoting between applications.
Now I let a windows service host the remote object. The protocol is ipc.
I get an acces denied error??
Do I need some additional settings for it to work in a w-service?
This is the server side code
thanks in adv , RichardCode:Imports System Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.Ipc Imports RemoteObject Imports System.Timers Imports System.Threading Imports System.Diagnostics Imports System.Runtime.InteropServices PublicClass TrafficService PrivateWithEvents m_Timer AsNew Timers.Timer Dim thdServer As Thread #Region"Event Handlers" ProtectedOverridesSub OnStart(ByVal args() AsString) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. thdServer = New Thread(New ThreadStart(AddressOf ServerThread)) thdServer.Start() m_Timer.Interval = 900000 '1800000 m_Timer.Start() EndSub ProtectedOverridesSub OnStop() ' Add code here to perform any tear-down necessary to stop your service. m_Timer.Stop() ChannelServices.UnregisterChannel(ChannelServices.GetChannel("serverchannel")) thdServer.Abort() EndSub PrivateSub m_Timer_Elapsed(ByVal sender AsObject, ByVal e As System.Timers.ElapsedEventArgs) Handles m_Timer.Elapsed Beep() Beep() EndSub #EndRegion'Event Handlers PublicSub ServerThread() Dim serverChannel As IChannel = New IpcServerChannel("serverchannel", "msg") ChannelServices.RegisterChannel(serverChannel, False) RemotingConfiguration.RegisterWellKnownServiceType( _ GetType(RemObject), "msgAlerter", WellKnownObjectMode.Singleton) EndSub EndClass


Reply With Quote