I am writing a program using .Net 3.5 and OpenCV 1.1. I have multiple threads that need to get an image variables from the web camera on my computer, the problem being I get memory violation errors when multiple threads try to access the camera at the same time. I know I can use PostThreadMessage and GetMessage to send a variable to the threads. Can anyone give me a tutorial or example of how to pass a variable to a thread while it is running using PostThreadMessage and GetMessage?
The errors I get are memory access violation errors, when both of my worker threads try to call a function that gets an image from the camera. I want to get around this by having one thread get the images for all of the others. They each have their one IplImage variable that stores the image captured by the camera. Hope this helps.