| |||||||||||
Error when running C++ application with 'exec' Posted by Dimon (Dimon), 23 September 2005 Hi all.My Tcl/Tk application is a GUI for C++ program, it calls C++ program with different command line parameters. All still worked correctly but at the end of developing I found a unanderstandable error. When I customary call C++ program with 'exec' command, I recieve an error: Code:
where: TestRider.exe - my C++ program -BuildTable, -NewDevicename, -TesterTable are the keys Paths are a values for corresponding keys. Double slashes need for correct parsing inside c++ program. The calling string is: Code:
Where value of 'directive' variable shown up. If I run that command like standalone tcl script with tclsh84 or wish84, C++ program called and work correctly. But when I call it from my own Tk-shell, it return the error showed up. I don't know what to do 'cause I call this C++ program many times in my Tcl/Tk application and it work correctly! Any ideas about what I made wrong and how to fix this error? Posted by admin (Graham Ellis), 24 September 2005 I think the problem is that you have your command name and parameters all in the same variable that's passed into the exec, so that your program is looking for a command who's name is the entire command line and not just the command name.Here's an example that I hope clarifies that: Code:
The first section gave an errot message (as per your report) and the second section worked. Here's the output: Code:
Posted by Dimon (Dimon), 26 September 2005 Oh, thank you, simple and interesting.But I have solved this problem by calling that C++ program in separate thread More complex but it's working. This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |