Ahoy thar,
I am attempting to run a .exe program (a small helper app written in another language) from within an existing TD6.3 application.
Going by the documentation, I'd think this works with SalLoadApp (or ideally with SalLoadAppAndWait, since I do need to wait for it to finish and would like it to be invisible to the user - the app is a console app with no visible output or user interaction), but trying to call it like that does nothing at all. I've tried both just the appname as a parameter (it's in the same folder as the TD application):
Call SalLoadApp('HelperApp.exe', '')
as well as the full path:
Call SalLoadApp('C:\Users\user\ProjectFolder\HelperApp.exe', '')
Am I misunderstanding how this works or missing something there? Does it only work with TD applications? Is there another way of executing an existing non-TD .exe file via code?
Yes you can use SalLoadApp for that purpose. The function can be used for invoking any exe file(no restrictions like only td exe's). For example, If you want call windows calculator just write,
SalLoadApp( "calc.exe", "" )
Also if you want specify file path, then please use double slash(instead of singleslash) as shown below,
Call SalLoadApp('C:\\Users\user\\ProjectFolder\\HelperApp.exe', '')
The format for SalLoadApp is: SalLoadApp( strAppName, strParameters )
strAppName - Name of exe file.
strParameters - Parameter array(space in strParameters marks the end of one argument).
Also If you want call salloadapp without specifying the filelocation, then you can keep the both exe's in same folder- ( HelperApp.exe and calling application)