Since you can’t write DLLs with Xojo, whats the best way to call a seldom used part of an application? For example, a preferences screen is often used initially and then ignored for most of the life of the app. Its a shame to have program utilities hogging memory space. On my previous development platform, I could use the shell command i.e.: shell "c:\\ and external executable"
, but in Xojo, I am not sure how to do this. I am not even sure if Shell is the solution.
I would imagine adding an extra window with a few controls on it will not result in an appreciable increase in resources (RAM) required by the application. You can test it, compile two identical applications but add a window with some controls and code to one of them. Run them and check the memory required by each of them.
If you still want to do that, a “helper application” could be the wayt to go: create a second application you launch only when needed. There will be some overhead involved (in terms of RAM used by the main application) since you will have to code the communication between the two applications.
I don’t think the saving you can get will be worth the effort and the complexity it will bring.
Julen
If you want to go down this path, you can use the shell class to launch a folderitem with parameters or just launch it.
Dim sh as new shell
Dim myApp as FolderItem = GetFolderItem("MyApp.exe")
sh.Execute(myApp.ShellPath + " whatever parameters you need")
Or
Dim myApp as FolderItem = GetFolderItem("MyApp.exe")
MyApp.Launch
If you’re going to set preferences in a separate application then you might need a way to tell the main application that the preferences have changed, if it’s running at the same time. You could have the preferences application end with a “restart the main application” notice but personally I hate it when that happens. Depends on what preferences you’re changing, of course. I have written multi-language applications where one preference is for the on-screen language; if the language is changed, I change all the texts on all the open windows immediately.
[quote=137934:@Greg O’Lone]f you want to go down this path, you can use the shell class to launch a folderitem with parameters or just launch it.
Dim sh as new shell
Dim myApp as FolderItem = GetFolderItem(“MyApp.exe”)
sh.Execute(myApp.ShellPath + " whatever parameters you need")
Or
Dim myApp as FolderItem = GetFolderItem(“MyApp.exe”)
MyApp.Launch[/quote]
Thanks Greg, butI guess that paradigm would only work for those who have paid for the ability to build apps and those not doing development on that so called ‘killer app’. Given that you would want to shell out to an .EXE or .APP that one has created, you couldn’t test this until you have purchased the ability to compile the program into an executable.
I’m not sure about that. You can have your helper app running in “Debug Mode” by using Project - Run Paused, then launch it with your main app. You’d just need to point your shell at the debug location of the helper.