Note: Using MFC

I am wanting a thread to suspend itself and then later from another thread resume it.

I tried some diffrent code and the thread kept executing, I need it to stop until I resume it from the other thread.

code below is what I tried

*static*/ UINT CBintodumpDlg::ThreadProc (LPVOID pParam)
{
THREADPARMS *ptp = (THREADPARMS*)pParam;

Do Stuff

I tried this

//ptp->thread points to this thread
//ptp->thread->SuspendThread(); // program bombs
//CWinThread::SuspendThread(); // program bombs
//SuspendThread(NULL); //continues processing,
//why does this require a
// parameter?
//SuspendThread(ptp->thread); //programbombs

Do More Stuff

delete ptp;
return 0;
}