dev-c++ to "call" another program
-
-
Hello, I tried to put a programme into the main one as a function, but it didn´t work. Is there a way to "call" another program from the main one? Please don´t use much technical language, as I´m only beginning. All help would be much appreciated.
I suggest you look here[^]. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
Hello, I tried to put a programme into the main one as a function, but it didn´t work. Is there a way to "call" another program from the main one? Please don´t use much technical language, as I´m only beginning. All help would be much appreciated.
-
Hello, I tried to put a programme into the main one as a function, but it didn´t work. Is there a way to "call" another program from the main one? Please don´t use much technical language, as I´m only beginning. All help would be much appreciated.
The first two replies suggest "ShellExecute". However, that's "launch", not "call" as a function. If you want a "return value" or other "results" of the program[me] then you will need a more technical discussion on what you want. CreateProcess()[^] allows you to monitor the completion, get the completion status (which could mean anything to your application, like a result) or do other ways of getting more complex results. Good luck.
-
I think you want to launch another program in your application. ::ShellExecute(NULL,_T("open"),_T("notepad.exe"),NULL,NULL,SW_SHOWNORMAL); It will launch notepad.exe. Regards
-
Hi Pranit, Thanks for the info. Do I need a special header for ::ShellExecute, type include for devc++?
Follow the link provided by Luc. Since you are only beginning, this will serve you well. The documentation he points to contains everything you need to know about including it, the "prerequesite calls" and the header file that must be included. MSDN documentation follows that standard for all the calls so you can determine that for anything. No need to ask and sit and wait for someone to answer, it's all in your hands.
-
Hi Pranit, Thanks for the info. Do I need a special header for ::ShellExecute, type include for devc++?
-
The first two replies suggest "ShellExecute". However, that's "launch", not "call" as a function. If you want a "return value" or other "results" of the program[me] then you will need a more technical discussion on what you want. CreateProcess()[^] allows you to monitor the completion, get the completion status (which could mean anything to your application, like a result) or do other ways of getting more complex results. Good luck.
Hi Chuck, Your reply seems just what I need. Sorry about the lack of information, it´s just lack of experience on my part. What I´m trying to do is to read an entering car´s number plate, which is done by ANPR camera and software (bought) which includes OCR,get the number plate from this program, then compare it with about 400 registered cars. If a match is found, another program sets one of the pins of the parallel port, so I´ve got to execute my 3 programs sequentially to achieve the desired result. The main program fills in a database with number plate, address and owner name, with editing facility. My second program gets the entering number plate and checks it against the forementioned list, and the third program lets the car in by opening the gate if the compare is true. Well, that´s about it. Of course, I´m struggling along trying to keep afloat, and the replies I´ve had have all pointed in the right direction, I think. If you have any suggestions at all which could help, I´ll gratefully accept. Thanks again..