Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / May 2005

Tip: Looking for answers? Try searching our database.

Need to fill gaps for creating a remotable singleton

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sethlivingston@gmail.com - 23 May 2005 20:19 GMT
Hi,

I've poured throught the MSDN documention on remoting; I'm close to
getting things working, but I need to fill in some gaps. Here's what I
need:

1. Remotable Controller class in MySystemTray.exe must be a singleton.
It controls the icon in the system tray and a Windows Form that you can
view by double-clicking the icon in the system tray.

2. Clients must be able to access that instance to show or hide the
Windows Form, or to ask MySystemTray.exe to exit.

3. We have to let the system choose the tcp port; we can't hard-code a
specific port. We can use named ports, though.

Controller class implements IController from a shared DLL and inherits
from MarshalByRef; by itself, it works fine.

So my question is this: What does the .config file on MySystemTray.exe
look like, and what does the .config file (and C# code) on MyClient.exe
look like?

I've tried new, .GetObject, and .CreateInstanceFrom, and none of them
produce the results I'm looking for. Figuring out how to use a system
chosen (albeit named) port has also been difficult--you can't get a URI
from IChannel.

Thanks!
sethlivingston@gmail.com - 25 May 2005 17:19 GMT
>From what I've learned, this can't be done. A singleton in Remoting
just isn't a true singleton if you're talking about two different
processes talking to each other. I ended up using
RegisterWindowMessage() and PostMessage() instead, even though it was
somewhat of a messy solution.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.