Complicated programming issue [C++] Watch
Failing that is it possible to have the commandline program running in the background awaiting input from the gui. The program needs to do about 1 second of processing before it can display an image which makes running it everytime I need a new image very bad indeed.
Any help would be appreciated.
If you want to communicate with the command line program in a way that doesn't involve spawning a new instance for each request that the command line program needs to be designed for this. In the simplest case it might wait on input from stdin and spool output to stdout.
Unfortunately, most processes that do this exit after one lump of valid input, but if not, just continually feeding it valid input and reading valid output from its stdout should work. There are potentially buffering issues that might cause deadlocks though.
Other options are using shared memory and various ipc primitives (events, mutexes) to hand off requests, or using some form of sockets to pass requests. Again, in either case, the commandline process has to be designed to do these.
You have indicated that you are using C++ but it sounds that you may need to do some implementation specific solution. If so, you should probably state what environment you are developing for.
Im using Visual Studio 2005.
Perhaps you could go into more detail about the components and the exact problem you're having. I don't really understand what's going on. What's the "certain object" that prevents things from working, for example?