Re: Several instances of the same App
Jean-Luc Arnaud <jean-luc-E/[email protected]>
| Newsgroups | gmane.comp.lang.realbasic.user |
|---|---|
| Organization | Centre Direct du Multimédia |
| Message-ID | <[email protected]> |
Hi Arnaud, I don't know if this may be of any interest for you, but here is a way to shorten your code: - You may launch the slave app and pass it parameters in the same command, using FolderItem.Launch(parameters as String) in the Master App, and getting these parameters with the System.CommandLine function in the slave. - This works for Windows, Linux and Mac as well, - For the Mac, launch will not run a new instance of the slave app. Instead, use a shell command "open -n SlaveAppPath --args Parameters". Try it, it's magic! HTH Jean-Luc Arnaud Le 10/05/2017 à 19:00, Marnaud a écrit : > Le 9 mai 2017 à 10:26 du matin, Jean-Luc Arnaud <[email protected]> a écrit: > >> Hi all, >> >> Since the last versions of Xojo, renaming a Xojo compiled App leads to an error message on Windows. >> >> As I'm often working with Master/Slaves apps, launching as many slave apps as needed, renaming them App01, App02, ..., AppXX, I can't no longer work this way. >> So, I know it's possible to launch several instances of the same app, with the same name. >> >> Here are my questions: >> - Is it safe to say that I will always be able to launch several instances of the same app, or are there some conditions making that impossible? >> - When (of if) this is not possible, hao to deal with Master/Slaves apps? >> >> Thanks for any advice, idea and help. > Hello Jean-Luc, > > When I use a master/slave combination of apps, I don’t rename either apps. I just do that way: > > •Have an array of IPCSockets in the master app; > •Have an IPCSocket in the slave app; > •When you plan to launch your slave app, add an IPCSocket in the array; make it listening and launch the slave app; > •The slave app, on launch, connects to the master app; > •The master app sends a unique ID (e.g. an integer, a counter) to the slave app; > •Both apps disconnect > •The master app listens again, this time using the counter sent to the slave (e.g. “<path to temp>/MyApp0005”); > •The slave app, after a short period of time, connects using the counter. > > Hoping it gives you some idea. > _______________________________________________ > > Xojo forum: > > https://forum.xojo.com/ > _______________________________________________ Xojo forum: https://forum.xojo.com/