If you *can* add some code to your application, then I do this kind of thing all the time -- I compile together a winbatch program to do a certain crazy thing, then call that exe from within my ancient ERP system, and then collect the simple integer return value. ( using intcontrol(1000,p1,0,0,0) ) Almost any platform will let you execute a command line and collect the return value.
If I need a more complex return values, the simple solution is a text file in the TEMP folder. Klunky, but if you are not doing it very often, is there much difference between a 1000th of a second and a 10th of a second?