Forcing Single Instance Of Application



I have an MFC application that accepts command-line parameters when
launched. The parameter is just a filename, which allows me to associate a
file type in Windows and then just double-clicking a file will launch my
application.

But, I really need to make sure that there is always only one instance of
the application running. So, if the user double-clicks an associated file
and the app is already running, I need to detect that and somehow tell the
running application to load the file.

I remember, way back in the day, that WinAmp used to do this (I guess it
still does). It used something called "DDE". I looked over the MSDN
documentation on DDE and it looks horribly overcomplicated for something
this simple. Is there an easier way?
.



Relevant Pages

  • Re: Persistent VFP COM Server with GUI
    ... command-line parameters, but unfortunately, this is only one-way. ... DDE is the option, but its really old technlogy;) and needs a lot of work. ... Winsock relies on TCP/IP stuck and I don't know how it works if user has, ... creating COM/OLE Automation application will be a piece of cake:) But ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Word and Excel files opening extremely slow
    ... Go to Control Panel, Folder Options, File Types, scroll down to and select or XLS, click Advanced, select Open entry, click the edit Button. ... Now uncheck "Use DDE" and then put your cursor in the Application box, arrow all the way to the right and put in "%1", IF there is /dde remove it. ... Most likely the reason there isn't an Office quick launch. ...
    (microsoft.public.office.misc)
  • Re: Bloomberg
    ... You can have dde send any valid bberg command to the terminal. ... clicks on a cell with a ticker in it, that ticker gets sent to the ... > Looks like you've had a lot of experience with Bloomberg. ... > to launch / login. ...
    (comp.soft-sys.matlab)
  • Re: recent security patch breaks desktop.ini CLSID folder-app association and custom icon
    ... Alec S. wrote: ... key if it works through DDE. ... _launch_ the app in the first place? ...
    (microsoft.public.windowsxp.customize)