I am writing a dialog-based program where the main dialog forks off a new "worker" thread to run an image processing function using a camera for input. I am using this new thread so that the UI can still be used to alter variables in the image processing program (thresholds, template sizes, etc.) My code works fine when all I want to pass into the new thread is say an int*. But what I really need to do is create a struct of variables which the two threads will share, and thus pass this struct into the function which starts the new thread.
Here's the problem- I get all kinds of assertions that seem to be related to the new struct I defined with typedef. I've tried putting it in all different files (the dialog, a new header file, main app header...) There is some sort of bug that calls it a "redefinition" even if it's only declared once in a new header. And, quite annoyingly, the compiler decides that CDialog is undefined among other things, all in relation to this new struct not being understood.
Does anyone know where I ought to be defining this struct, or how I can get around this problem? I would be very grateful.
Kristen
Here's the problem- I get all kinds of assertions that seem to be related to the new struct I defined with typedef. I've tried putting it in all different files (the dialog, a new header file, main app header...) There is some sort of bug that calls it a "redefinition" even if it's only declared once in a new header. And, quite annoyingly, the compiler decides that CDialog is undefined among other things, all in relation to this new struct not being understood.
Does anyone know where I ought to be defining this struct, or how I can get around this problem? I would be very grateful.
Kristen