Loading documents in MDI Applications

samsmithnz

Senior Contributor
Joined
Jul 22, 2003
Messages
1,038
Location
Boston
I have an application that I've developed where I can double click on an XML file and it will open up in my MDI application. How do I get a SECOND xml file I double click to open in the SAME instance of the MDI application as the FIRST xml file????
 
I would imagine it has something to do with with how windows handles the file association. I know the registry settings that determines what a file opens with, but I don't know where in the registry, if even there, it determines whether to create a new instance of an application or to use an existing opening one; maybe that's something in the program. In the past when I've had those kind of issues I actually made my load routine of my program look for other instances of it running and if it was call a procedure on that other instance to open that file and then I would immediately close the loading instance, thus it never showed up. That was a long time ago and in VB6 and probably wasn't the best way, haven't done anything in that scope in sometime now. Good luck, let us know what you come up with, will be good for knowledge base.
 
How to pick up the path of the file that was double clicked in windows and how to run the code that opens and displays the file?
 
no, how to create an application that opens the files in the same instance each time a new file is clicked. Try opening two word documents, or two .vb files and you'll see what I mean.
 
Back
Top