Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: using classes in different directory Pin
Maximilien5-Dec-03 2:38
Maximilien5-Dec-03 2:38 
GeneralRe: using classes in different directory Pin
hdaly5-Dec-03 2:59
hdaly5-Dec-03 2:59 
GeneralPrinter driver Pin
BEamer5-Dec-03 1:45
BEamer5-Dec-03 1:45 
GeneralRe: Printer driver Pin
Alexander M.,6-Dec-03 1:25
Alexander M.,6-Dec-03 1:25 
GeneralThreads and windowless ActiveX controls Pin
BadJerry5-Dec-03 1:34
BadJerry5-Dec-03 1:34 
GeneralRe: Threads and windowless ActiveX controls Pin
Mike Dimmick5-Dec-03 2:58
Mike Dimmick5-Dec-03 2:58 
GeneralRe: Threads and windowless ActiveX controls Pin
igor19605-Dec-03 8:44
igor19605-Dec-03 8:44 
GeneralRe: Threads and windowless ActiveX controls Pin
Peter Molnar5-Dec-03 14:45
Peter Molnar5-Dec-03 14:45 
If you wanna fire an event at the end of your worker thread then the best thing is to monitor your thread execution status with GetExitCodeThread and fire the event directly from your control class. In order to do this you have to set the thread's autodelete member to FALSE.
This should do the job:
CWinThread* pThread = AfxBeginThread(...,CREATE_SUSPENDED);
pThread->m_bAutoDelete = FALSE;
pThread->ResumeThread();

DWORD dwExitCode;

while (TRUE)
{
   GetExitCodeThread(pThread->m_hThread, dwExitCode);
   if (dwExitCode != STILL_ACTIVE)
   {
      FireYourEvent();
      break;
   }
   else
      SleepABitAndPumpMessages();     
}


Peter Molnar
Generalabout using view in a dialog application Pin
coda_x5-Dec-03 1:30
coda_x5-Dec-03 1:30 
Generalcreating a library (with Qt) Pin
Jerome Conus5-Dec-03 1:18
Jerome Conus5-Dec-03 1:18 
GeneralRe: creating a library (with Qt) Pin
BEamer5-Dec-03 1:42
BEamer5-Dec-03 1:42 
GeneralRe: creating a library (with Qt) Pin
Jerome Conus5-Dec-03 1:53
Jerome Conus5-Dec-03 1:53 
GeneralRight to left toolbar Pin
Anonymous5-Dec-03 1:00
Anonymous5-Dec-03 1:00 
GeneralRegion::GetData in GDI+ Pin
OKN5-Dec-03 0:10
OKN5-Dec-03 0:10 
Generaldatabase Pin
Dennis L4-Dec-03 23:36
Dennis L4-Dec-03 23:36 
GeneralRe: database Pin
Steve S5-Dec-03 0:49
Steve S5-Dec-03 0:49 
GeneralRe: database database Pin
Dennis L5-Dec-03 4:29
Dennis L5-Dec-03 4:29 
GeneralRe: database database Pin
Steve S5-Dec-03 5:50
Steve S5-Dec-03 5:50 
GeneralDisplaying Images Pin
ineedhelp4-Dec-03 22:54
ineedhelp4-Dec-03 22:54 
GeneralRe: Displaying Images Pin
Monty25-Dec-03 1:45
Monty25-Dec-03 1:45 
GeneralRe: Displaying Images Pin
Big Art5-Dec-03 5:38
Big Art5-Dec-03 5:38 
Generalvoid-casting unused return values Pin
Johann Gerell4-Dec-03 22:42
Johann Gerell4-Dec-03 22:42 
GeneralRe: void-casting unused return values Pin
фил4-Dec-03 23:10
фил4-Dec-03 23:10 
GeneralRe: void-casting unused return values Pin
Mike Dimmick4-Dec-03 23:44
Mike Dimmick4-Dec-03 23:44 
GeneralRe: void-casting unused return values Pin
cmk5-Dec-03 11:40
cmk5-Dec-03 11:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.