//I have in header unsigned char MyData[32];
//I want the data in this array to be able to be used within the thread and
//then returned with the modified data.
//I have this now
void CAdelphiXDlg::OnTest()
{
AfxBeginThread(runThread,(LPVOID)m_hWnd); //works
c_Info.SetWindowText("Thread Started...");
}
//How do I change it to pass the that unsigned char array?
===========================================================================
//how do I retrieve the unsigned char array in the thread below?
UINT runThread( LPVOID Param )
{
HWND hDlg = (HWND)Param;
KillThread = false;
do{
MessCode = 0; //started
::PostMessage(hDlg, RunMsg, (WPARAM)0, (LPARAM)0);
//do code manipulation which can take up to 30secs
//which is why I might need to kill if stuck
MessCode = 1; //finished
::PostMessage(hDlg, RunMsg, (WPARAM)0, (LPARAM)0);
}while(!KillThread);
return 0;
}