Click here to Skip to main content
15,924,507 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: equation editor and mathematical function evaluator Pin
Chris Richardson15-Nov-02 7:42
Chris Richardson15-Nov-02 7:42 
GeneralMDI Maximized windows Pin
Steve S12-Nov-02 21:57
Steve S12-Nov-02 21:57 
GeneralRe: MDI Maximized windows Pin
Eugene Pustovoyt12-Nov-02 23:49
Eugene Pustovoyt12-Nov-02 23:49 
GeneralRe: MDI Maximized windows Pin
Steve S13-Nov-02 3:25
Steve S13-Nov-02 3:25 
GeneralRe: MDI Maximized windows Pin
Neville Franks13-Nov-02 10:47
Neville Franks13-Nov-02 10:47 
QuestionHow to test a thread handle is valid handle? Pin
Lizp12-Nov-02 21:40
Lizp12-Nov-02 21:40 
AnswerRe: How to test a thread handle is valid handle? Pin
Daniel Turini12-Nov-02 22:06
Daniel Turini12-Nov-02 22:06 
GeneralRe: How to test a thread handle is valid handle? Pin
Lizp12-Nov-02 23:00
Lizp12-Nov-02 23:00 
thank you for your help,but my code goes like:
In main thread.
<br />
if(m_pScanThread && m_pScanThread->m_hThread != NULL)<br />
{<br />
    m_pScanThread->PostThreadMessage(UWM_TIMERON,0,0);<br />
}<br />
else<br />
{<br />
    m_pScanThread = AfxBeginThread((AFX_THREADPROC)fnScanProc,NULL);<br />
    if(m_pScanThread && m_pScanThread->m_hThread != NULL)<br />
	m_pScanThread->PostThreadMessage(UWM_TIMERON,0,0);<br />
}<br />

Thread function.
<br />
CoInitializeEx(NULL,COINIT_MULTITHREADED );<br />
try<br />
{<br />
//Do some Initialize<br />
DWORD dwRet;<br />
MSG msg;<br />
while(dwRet = GetMessage(&msg,NULL,0,0) != 0)<br />
{<br />
    if(dwRet == -1)<br />
    {<br />
        continue;<br />
    }<br />
    else<br />
    {<br />
	if(msg.message == UWM_TIMERON)<br />
             Scan(...);<br />
	else<br />
	     DispatchMessage(&msg);<br />
     }<br />
  }<br />
}<br />
catch(...)<br />
{<br />
   return -1;///Here! if return then the m_pScanThread's( member of the main<br />
             ///thread)member m_hThread is 0xfeeefeee<br />
             ///and at this time i want to re - AfxBeginThread... <br />
   ::CoUninitialize();<br />
}<br />
::CoUninitialize();<br />
return 0;


Scratch
GeneralRe: How to test a thread handle is valid handle? Pin
Daniel Turini12-Nov-02 23:23
Daniel Turini12-Nov-02 23:23 
GeneralAWARE!! Re: How to test a thread handle is valid handle? Pin
Hugo Hallman16-Nov-02 9:15
Hugo Hallman16-Nov-02 9:15 
GeneralCCriticalSection, CDatabase, CRecordset Pin
zecodela12-Nov-02 21:37
zecodela12-Nov-02 21:37 
GeneralStatusbar update problem Pin
Anonymous12-Nov-02 21:17
Anonymous12-Nov-02 21:17 
Generalproblem with unicode and XML Pin
12-Nov-02 21:04
suss12-Nov-02 21:04 
GeneralRe: problem with unicode and XML Pin
Alois Kraus12-Nov-02 21:47
Alois Kraus12-Nov-02 21:47 
GeneralRe: problem with unicode and XML Pin
Anonymous12-Nov-02 22:47
Anonymous12-Nov-02 22:47 
GeneralRe: problem with unicode and XML Pin
Alois Kraus13-Nov-02 7:06
Alois Kraus13-Nov-02 7:06 
GeneralRe: problem with unicode and XML Pin
Ernesto Perales Soto13-Nov-02 14:03
Ernesto Perales Soto13-Nov-02 14:03 
GeneralCommandBars missing... Pin
Daniel Strigl12-Nov-02 20:38
Daniel Strigl12-Nov-02 20:38 
GeneralInt2Type Generic Programming :: C++ Pin
valikac12-Nov-02 20:34
valikac12-Nov-02 20:34 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Christian Graus12-Nov-02 20:48
protectorChristian Graus12-Nov-02 20:48 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Joaquín M López Muñoz12-Nov-02 21:49
Joaquín M López Muñoz12-Nov-02 21:49 
GeneralRe: Int2Type Generic Programming :: C++ Pin
valikac13-Nov-02 11:11
valikac13-Nov-02 11:11 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Joaquín M López Muñoz13-Nov-02 11:17
Joaquín M López Muñoz13-Nov-02 11:17 
GeneralRe: Int2Type Generic Programming :: C++ Pin
valikac13-Nov-02 11:29
valikac13-Nov-02 11:29 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Joaquín M López Muñoz13-Nov-02 11:44
Joaquín M López Muñoz13-Nov-02 11:44 

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.