user1439447
user1439447

Reputation: 11

how to run one program created exe file from another program in turbo c?

i am developed a program in dev c++ compiler name of file is CorrectPrgm.cpp and want to run CorrectPrgm.exe created by CorrectPrgm.cpp file. from Le.cpp which was developed in turbo c++ 3.0 compiler and my need is at the time of running Le.cpp i want to invoke/run CorrectPrgm.exe. The CorrectPrgm file accepts file name from user and produces output as list of tokens.

i have tried like this:

system("C:\\CorrectPrgm.EXE");

not working.. any other way to call... Any help would be appreciated..

Upvotes: 0

Views: 2234

Answers (3)

user1020710
user1020710

Reputation:

you can create a separate process for the program you want to invoke. But you will face a lot of problems. Firstly. correctPrgm.exe and le.exe will execute in two separate process. So you have to consider interprocess communication. The best thing I'd suggest is break the CorrectPrgm.exe source file in functions and call the functions you need. Even you can use library and header file(s) to get the functionality of those functions. You can also create threads. But then you have to design the threads (in one thread the CorrectPrgm will run) very carefully.

Upvotes: 0

malkia
malkia

Reputation: 1387

If you are on Windows Vista and above, probably you can't run it, as I believe this would be a 16-bit DOS applications. If it's 32-bit DOS app (proteced mode through DPMI, but unlikely) then it might run too, but that was too long ago to remmember how.

On Windows 7, you can install Windows XP mode (actually Virtual PC builtin kind of), and run it from there. XP still supports 16-bit apps.

Upvotes: 1

Superman
Superman

Reputation: 3083

I believe you can use one of the exec or spawn functions.

Upvotes: 0

Related Questions