Ask Your Question
0

Multiple windows - destroyWindow hangs

asked 2018-05-21 23:12:03 -0600

djtommye gravatar image

I have a MFC C++ slideshow program that I've written, which uses a thread to display images on a secondary monitor.

I just added code to also show the same image, scaled down, as a thumbnail on the primary monitor. However, when I call destroyWindow(), the call hangs.

The code is as follows:

    destroyWindow(SCREEN_TITLE);
    waitKey(1);
    destroyWindow(THUMBNAIL_TITLE);
    waitKey(1);

I added the waitKey after reading that suggestion in another forum topic, but the second call to destroyWindow never returns??

Also - the second window has an aero cursor, while the first window has cross hairs.

Any help would be appreciated!

edit retag flag offensive close merge delete

Comments

all opencv gui functions have to stay in the main thread.

and waitKey() only has an effect, IF there is any opencv gui window

berak gravatar imageberak ( 2018-05-22 03:50:42 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-05-22 23:13:46 -0600

djtommye gravatar image

Thank you, berak. That fixed it. I posted a custom message to the parent process to display the image and everything is much better now. THANK YOU!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-05-21 23:12:03 -0600

Seen: 645 times

Last updated: May 21 '18