For months now I've been trying to open and run a Dos program using Builder C++ and CreateProcess. The only way I can get the Com ports to work properly with the Dos program in Windows95\98 is with a Batch file and CreateProcess. I have pieced together a CreateProcess and batch file, which I would like someone to check before I add this into the final program. I'm not 100% sure if what I have is needed or not, or am I missing something. One Problem to note is that once I close the Dos program the Com port stays open. This is another issue.
CD "\Hi-Tech Software\JCM\CBA\CBATOOL"
void __fastcall TFormMain::ButtonCBAToolClick(TObject *Sender)
memset (&pi, 0, sizeof(pi));
memset (&si, 0, sizeof(si));
si.cb = sizeof(si);
if ( !CreateProcess (
//"command.com /c \"C:\\Hi-Tech Software\\JCM\\WBA\\Adj\\adj10.bat\"",
"command.com /c \"C:\\Hi-Tech Software\\JCM\\CBA\\CBATOOL\\CBATOOL.BAT\"",
MessageBox(0, "Could not execte program \n Please contact software author.", "Error", MB_ICONSTOP);