|
-
December 21st, 2005, 11:19 PM
#1
Timers, Multithreading and annoying programming problems!
Hi everyone,
I have an MFC Dialog-Based application with an OpenGL class showing in a static text window and working fine with mouse interaction. I am also trying to capture live feed from a webcam in the same application, same dialog, and display it in a bitmap window. I was able to capture the way i want it without the OpenGL class in the application, using a timer, but once I added it, it didn't work anymore, probably because the OpenGL function takes over. I figured I probably need to add multithreading to the capture, but this isn't working properly either, I keep getting problems with GetDlgItem not being a static function, and I'm not very familiar with multithreading. I'm not sure how to solve this problem, I have a couple of questions about things I tried to do:
1) Is it possible to set a timer in a class and have the callback function of the timer in another? The class I'm trying to set it in is a CWin Thread class.
2) Is it possible to have both webcam and OpenGL working without using multithreading using only the timer? If so where should I call the OpenGL class?
I'm calling the OpenGL function and create a new thread or call the timer in the OnDialog function. I tried to call the OpenGL class in the timer callback function, the camera captured and displayed 1 image but then stopped.
I don't know if this is a bit vague, I can give more details if necessary. I would appreciate any help, thanks!
Sabine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|