Re: Displaying a popup from a windows service using .NET remoting

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ken Kolda (ken.kolda_at_elliemae-nospamplease.com)
Date: 01/28/05


Date: Fri, 28 Jan 2005 15:22:12 -0800

Since your application displays a UI, the first question I'd have is this:
does this service need to be running when no one is logged into the server
to receive its messages?

If the answer is no, then you probably don't want a service or remoting --
you just want an app that launches on startup for a particular user. You'd
write you app and then add and reference to it in the
HKCU\Software\Microsoft\Windows\CurrentVersion\Run registry key for each
user.

If it needs to always be running, then you need two parts:

1) A Windows Service that acts as a remoting server.
2) A client UI piece that launches with each login (i.e. in the same
registry key I mentioned above) and acts as a remoting client.

When the UI piece starts up, it connects to the service and registers for
whatever events the server may raise (e.g. when a certain file is modified).
It then displays the UI as appropriate.

The reason you shouldn't have the UI be the server is two fold:

1) How will the service know when the UI is running (i.e. when someone is
logged in)? Would it try to connect to the UI every time an event occurs?
2) Your app wouldn't work in a terminal services environment since only a
single UI could listen on the specified server port. This may not be a big
issue for you, but something to note.
3) You could never use a remote client to connect to your server to
subscribe for events. Again, this may not be a big deal currently, but it
could be a design consideration.

Hope that helps -
Ken

"CBran" <cbrannon@ramquest.com> wrote in message
news:1106946406.083684.251220@c13g2000cwb.googlegroups.com...
> Hi, I'm working on developing a solution that requires me to display a
> notification to the user in the form of a winform, much like the MSN
> messenger popup or Norton 2004 popup. I am under the impression that
> these apps consist of 2 pieces (or 3 if you consider an interface the 2
> use) - a windows service that continually monitors for some event, and
> the winform app that appears (and disappears) when the event is
> received by the windows service. I think the winform app acts as the
> remoting server, and the windows service acts as the client that calls
> the server each time it wants the server to show the popup. I'm having
> a tough time finding a working example of a windows form that acts as
> remoting host and appears only when the windows service (remoting
> client) asks it to. Can anyone provide me with a simple example to
> show a form from a windows service using .NET remoting?
> Thanks so much,
> Chris
>



Relevant Pages

  • Re: Events in .Net Remoting
    ... I am writing with respect to the Events in .Net Remoting that I had ... another channel for the callbacks..both on client side. ... Then I force a method on the server end (through a GUI control on the ... >> the regular client side requests still work fine. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: passing structs (setializable) object in web service
    ... The philosophy of webservices is different than that of remoting. ... follow Seely's advice as Christoph pointed out earlier - you have to modify ... > having total control over both client and server types. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Looking For Code Sample and Request Feedback
    ... I would prefer to use a Windows Service but a web service will do to. ... What is very easy to do on a Server 2003 and with VBNet? ... > I am looking for a code sample that communicates from a client to a remote> Windows Service on another computer over the internet, that is the Windows> Service performing instructions the client sends. ... the client does the office automation and the actual> communication of the commands to this server. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Delegate Failure after Migration to .NET 2.0 - Vista
    ... remoting to work in .NET 2.0 for you? ... ActivatedClientTypeEntry entry = new ... I make the single below call in order to register my server type. ... the client. ...
    (microsoft.public.dotnet.languages.csharp)
  • Reuse of Remoting Channels...
    ... makes it possible for the server to know the identity of the caller. ... If my client is on the other side of a Windows 'realm' (as in the ... RemotingConfiguration options) to reject any clients whose credentials ... "Remoting server cannot be reached. ...
    (microsoft.public.dotnet.framework.remoting)