Talon
Badges: 18
Rep:
?
#1
Report Thread starter 11 years ago
#1
I am trying to create a GUI for a program using simple windows forms. Unfortunately the forms fail to display when a certain object is created (this object is integral to the program and cannot be worked around). This program was formerly a command line program that displayed images (using the cimg library). Are there certain things I may have missed removing that would cause this to happen?

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.
0
reply
Mathmoid
Badges: 0
Rep:
?
#2
Report 11 years ago
#2
I'm not sure I've understood fully enough. Presumably the command line program doesn't actually display images, otherwise it's not a pure commandline program (unless it coverts to ascii art)? I'm not familiar with the cimg library. I'm assuming that it just processes image data in some way.

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.
0
reply
Talon
Badges: 18
Rep:
?
#3
Report Thread starter 11 years ago
#3
Cimg creates a window somehow (im not sure about the specifics) but otherwise its basically a commandline program.

Im using Visual Studio 2005.
0
reply
Mathmoid
Badges: 0
Rep:
?
#4
Report 11 years ago
#4
That definitely makes it "not a commandline program" in my book then, and that invalidates most of what I've said.

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?
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

How has the start of this academic year been for you?

Loving it - gonna be a great year (141)
17.94%
It's just nice to be back! (212)
26.97%
Not great so far... (281)
35.75%
I want to drop out! (152)
19.34%

Watched Threads

View All