Hi,

I need help regarding VC++ Threading
Here is my piece of code:

Code:
CWinThread* thread=NULL;

thread= AfxBeginThread( LoadData(), this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED  );
thread->m_bAutoDelete = false;
thread->ResumeThread();

SUL_WaitForEndOfThread( thread->m_hThread );
I am getting access violation error in "SUL_WaitForEndOfThread( thread->m_hThread );"
When my compiler reaches "thread->ResumeThread();" it doesn't call LoadData().
Instead it moves to the next statement SUL_WaitForEndOfThread( thread->m_hThread ); and throws me a access violation error.

Need help in this.

Reagrds