[plt-scheme] How to open a source file in an already running DrScheme?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Apr 13 12:50:58 EDT 2004

When I first saw this thread, my reaction was "I really should have
fixed that by now --- why haven't I?"

At Tue, 30 Mar 2004 14:23:40 -0800 (PST), Gordon Weakliem wrote:
> You're correct, it's up to the application on Win32 to figure out that it 
> should reuse an existing application instance in this case. [...]
>
> [1] http://www.codeproject.com/cpp/avoidmultinstance.asp  

Oh, right. Now I remember.

This link was very helpful - thanks!

<rant>Despite all the complexity on the above page, the supplied code
merely brings an application window to the front (maybe), and doesn't
deal with passing files to the application to open. For opening files,
the given code has race conditions/timeouts that prevent reliable
opens. I'm not sure there's any way to do better; perhaps Microsoft
avoids providing decent support for single-instance apps because the OS
fundamentally can't support it right.</rant>

Instance re-use is now implemented for v299.3 and up. Within a MrEd
application, new files to open are delivered through
`application-file-handler', which makes it the same as for Mac OS.

Also like Mac OS, re-use is based on launching the same executable file
(in the same session and desktop), so a user can copy "drscheme.exe"
to get multiple instances of DrScheme.

Matthew



Posted on the users mailing list.