Quote Originally Posted by okinrus
The wait is there to prevent the application thread exiting while the worker thread still exists. If the wait times out, maybe your worker thread never exits from its callback function. You need someway to signal the worker thread to exit.
I made a silly mistake. I didnt try to finish to the thread. With the following code, it works. Sorry for wasting your time.
Code:
	TerminateThread( pStreamReadTask->m_hThread, NULL );
	WaitForSingleObject( pStreamReadTask->m_hThread, INFINITE );
	delete pStreamReadTask;
	pStreamReadTask = NULL;


I don't think that should occur. The worker thread is mainly doing fileio and won't be doing any extensive computation.

The code itself is kind of ugly with no error checking or exception handling. But if you want, PM me your email address and I'll send an email to you with the test program attached. The test program has a modal progress dialog, but uses a CEdit instead of a CProgressCtrl, and the files themselves are text files so it reads line by line and updates the dialog and view each time a line is read.
Then, I am probably doing something wrong. Without the sleep() function, the user thread doesnt seem to be working.
I will p.m you to give you my email addy. I really appreciate what you are doing for me.

Quote Originally Posted by novacain
>>I am having a compile error here m_ProgressBarDlg.Create(IDD_PROGRESSBAR_DLG,this);

Looks like you are just trying to create a progressbar control.

In the resource editor create a dialog with your progressbar on it. Derive a class from the dialog (CDialog).
Thank you. I will try to do it. I was stuck there.