Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using a worker thread, prob with typedef declaration

Status
Not open for further replies.

klg

Programmer
Mar 25, 2001
1
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top