Opening just one instance
-
I linked a file type with my program, such that if you double click on a file in explorer, it opens the file using my program. The only problem is if there's an instance of the program already open I want that instance to open the file rather than starting a new instance. (for example, if you double click a .doc file, you do not want start a new Word session if one is already open. Instead you want the existing word session to open the document). Anyone have any ideas on the best way to do this? John
-
I linked a file type with my program, such that if you double click on a file in explorer, it opens the file using my program. The only problem is if there's an instance of the program already open I want that instance to open the file rather than starting a new instance. (for example, if you double click a .doc file, you do not want start a new Word session if one is already open. Instead you want the existing word session to open the document). Anyone have any ideas on the best way to do this? John
While not a direct answer to your question, you can start with these two references: http://www.naughter.com/sinstance.html http://www.flounder.com/nomultiples.htm
-
While not a direct answer to your question, you can start with these two references: http://www.naughter.com/sinstance.html http://www.flounder.com/nomultiples.htm
We use the sinstance evrsion here at work. With a mod to the MMF structure such that if another instance starts up, it can copy the command line across into the object, send a registered message across to the other instance to tell it to open it and then kill itself. Works very well, just need to be careful about access to the MMF object. Need to avoid those race conditions, as you can open multiple docs at once in explorer. Roger Allen Sonork 100.10016 Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003