> Mostly, you have to do it yourself. One technique is discussed here:
>
> http://support.microsoft.com/kb/q243953/
tnx, that article is in fact about what i was looking for, tough i have not
seen it yet in detail to see how it does it, so i can not tell if i'll like
it or not
> Just by the way, Word takes advantage of the file associations maintained by
> the shell (Explorer).
>
> Files with .doc extensions are associated with winword.exe, so if winword is
> not already active, the shell will run it and pass the file name as an
> argument.
hmm.. i should have said "for example, not like word (...)" which in fact
opens a different instance for each document
William DePalo [MVP VC++] - 01 Jun 2005 01:16 GMT
> hmm.. i should have said "for example, not like word (...)" which in fact
> opens a different instance for each document
Hmm, not here. It all depends on how you run the subsequent instances.
I just clicked two different .doc files listed in an Explorer window. Both
documents end up being opened by the same instance of winword.exe (from
Office 2003) as the shell sends a DDE message to open the second instance.
Note that even if you follow the advice in the article, for a short time
there will be multiple instances of your executable running. Each subsequent
instance detects the presence of the first and exits. If you have a document
centric application which might need to open another document, it needs to
follow the shell's example and send a "message" to the first instance to
open it. Of course, you don't have to use DDE.
But the point is that the operating system does not a priori prevent
subsequent instances from being launched in the first place.
Regards,
Will