More hacking at NCD
Posted by mholmes on 26 Feb 2009 in Academic
Worked again on the problem of getting the stdout from a command-line application back into my Delphi app. Found an ancient component called TDosCommand which purports to do this, but it won't compile easily due to issues with the transition to UStrings; after some hacking, I got it to compile, but I still can't make it work. I get garbage back from the command, even though when I run it in a command window, I get the right result. I think I'm going to have to abandon this component, and try one of these strategies:
- Find out how to capture stdin and stdout using pipes (looks messy).
- Get the source code for ncd, specifically the c header files, and convert them for Delphi, so I can use the dlls directly (even more messy).
Both options would involve learning stuff that's potentially useful, but I think the second would give me access to more other open-source code in the long run. JEDI has good tutorials on how to convert C header files.