Posted on 2003-10-29
I keep running into this problem in my efforts to multithread successfully. As many of you know, there is a problem passing CObject derived objects from one thread to another. Right now here is my problem. I have a DCCConnection (a file download object). This object handles all of the connecting to a server and recieving of a file in a worker thread, the thread updates members of the DCCConnection object that contain information about download speed, progress, and percent complete. Now..in this DCCConnection object I have a CProgressDlg object (as a member) that I want to be displayed during downloads. I want to place a timer in this object that updates the dialog by checking the DCCConnection object members for the latest info and then updating the dialog display. Here is the problem. This all seemed to be good in theory...but what I need my dialog to have is a pointer to the DCCConnection object. I can't seem to include the DCCConncetion.h file in my progress header. It fails terribly at compile time. Now it might be helpful to know that DCCConnection.h already includes Progress.h and that I want Progress.h to include DCCConnection.h. The only way I can let the ProgressDlg object access the DCCConnection members is to give it a pointer to the DCCConnection object. What on earth is the problem here??