Why not just the old trick of using a Mutex?
Thanks,
Shawn Wildermuth
Note: This was typed on a big ole laptop so any misspellings and punctuations are completely my fault…not my phone’s.
I agree with Marlon that Named Pipes is the way to go. WCF supports named pipes so it might help you abstract the usage but also might be a bit excessive for your needs.
Sounds weird to me, so you have 1 instance that was started with certain command line args, and then you start another that affects the 1st instance. That's some weird requirement man.Anyway another way altogether would be to use some sort of distributed messager, like Mass Transit, or Rhino Service Bus, we talked about these just the other day. The are like a distributed mediator in effect.
--
Yes exactly - it's called the named pipe binding in WCF, and then you get to leverage the clean programming model of WCF of objects calling objects instead of writing and reading custom messages to named pipes yourself, as well as having to set up that named pipe yourself.Singleton WCF service at a known address (I.e. net.pipe://localhost/myapp), try to call it at startup (before starting your own host for one if not found), good to go. Can probably throw together a little example in 5 minutes for you a little later.
If you are looking at it from an overhead perspective, I guess it depends on whether you think an extra 3M working set for loading System.ServiceModel into memory is going to matter to your users. The framework has to be on their machine to support it anyway, so not really any impact other than working set in my opinion.
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Peter O'Hanlon
Sent: Sunday, August 01, 2010 9:19 AM
To: wpf-di...@googlegroups.com
Subject: Re: [WPF Disciples] Single instance WPF apps
I'm already doing that. I was just wondering really whether this was too heavyweight as it puts extra references into the client project.
Here's a link on memory mapped files in 4.0. If you are not using 4.0 you need to use Windows APIs to access it: http://msdn.microsoft.com/en-us/library/dd997372.aspx
On Sat, Jul 31, 2010 at 9:14 PM, Glenn Block <glenn...@gmail.com> wrote:
Mutex gives you the lock but how does it hangle sending across the params? You could use a memory mapped file for passing data. I believe we expose managed apis for it.
I'm shocked to see the new WCF dealer suggesting grunging around with multiple low level communications approaches when your stack is perfect for this. You need a bigger pitcher of WCF Kool Aid my friend.:)
Thanks,
Shawn Wildermuth
Note: This was typed on a big ole laptop so any misspellings and punctuations are completely my fault…not my phone’s.
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Glenn Block
Sent: Sunday, August 01, 2010 12:18 AMSubject: Re: [WPF Disciples] Single instance WPF apps
Interesting side note....with COM support in SL you could probably use memory mapped files to pass state between an inproc app and an SL one. Not sure you would want to...but cool that you can :-)
Thanks,
Shawn Wildermuth
Note: This was typed on a big ole laptop so any misspellings and punctuations are completely my fault…not my phone’s.
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Glenn Block
Sent: Sunday, August 01, 2010 12:18 AMSubject: Re: [WPF Disciples] Single instance WPF apps
Interesting side note....with COM support in SL you could probably use memory mapped files to pass state between an inproc app and an SL one. Not sure you would want to...but cool that you can :-)
Thanks,
Shawn Wildermuth
Note: This was typed on a big ole laptop so any misspellings and punctuations are completely my fault…not my phone’s.
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Glenn Block
Sent: Sunday, August 01, 2010 12:18 AMSubject: Re: [WPF Disciples] Single instance WPF apps
Interesting side note....with COM support in SL you could probably use memory mapped files to pass state between an inproc app and an SL one. Not sure you would want to...but cool that you can :-)
Thanks,
Shawn Wildermuth
Note: This was typed on a big ole laptop so any misspellings and punctuations are completely my fault…not my phone’s.
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Glenn Block
Sent: Sunday, August 01, 2010 12:18 AM
To: wpf-di...@googlegroups.com
Subject: Re: [WPF Disciples] Single instance WPF apps
Interesting side note....with COM support in SL you could probably use memory mapped files to pass state between an inproc app and an SL one. Not sure you would want to...but cool that you can :-)
LMAO. To make my position clear though, I've been wondering whether requiring users to add the servicehost references for my MVVM framework is one that could put people off - honestly, I've been battling with myself on this one for 2 to 3 days now. It's the little things that cause the most grief.
On 1 August 2010 20:06, Brian Noyes <brian...@softinsight.com> wrote:
Alright, if you guys are going to start taking the "do it the hard way because it makes you cool", I am soo asking to be removed from the list.
On Sun, Aug 1, 2010 at 8:32 PM, Peter O'Hanlon <pete.o...@gmail.com> wrote:
That's what I've been debating (is WCF sup port a bad thing_ - and I'm now havering and looking the love on Dan's implementation. I may just be using a version of that.
--
Peter O'Hanlon
> --
> Peter O'Hanlon
>