Click here to Skip to main content
16,006,065 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question about CImageList.ExtractIcon(),thanks! Pin
YanBin24-Nov-03 6:04
YanBin24-Nov-03 6:04 
GeneralRe: Question about CImageList.ExtractIcon(),thanks! Pin
Roger Allen24-Nov-03 6:43
Roger Allen24-Nov-03 6:43 
GeneralRe: Question about CImageList.ExtractIcon(),thanks! Pin
David Crow24-Nov-03 5:50
David Crow24-Nov-03 5:50 
GeneralRe: Question about CImageList.ExtractIcon(),thanks! Pin
YanBin24-Nov-03 15:40
YanBin24-Nov-03 15:40 
GeneralRe: Question about CImageList.ExtractIcon(),thanks! Pin
David Crow25-Nov-03 2:43
David Crow25-Nov-03 2:43 
GeneralMulti-threading problem Pin
BHulme24-Nov-03 4:57
BHulme24-Nov-03 4:57 
GeneralRe: Multi-threading problem Pin
valikac24-Nov-03 5:39
valikac24-Nov-03 5:39 
GeneralRe: Multi-threading problem Pin
BHulme24-Nov-03 6:30
BHulme24-Nov-03 6:30 
I have inserted breakpoints in my code and can happily step through it without problem. Even the PostMessage command executes without incident right up to the point when the main thread (with the message queue) continues execution and then I get my Access Violation.

The thread setup code looks like this:

//START OF CODE<br />
UINT CThreadTimer::SetTimer (void* obj, UINT nIDEvent, UINT uElapse, ThreadTimerProc lpTimerProc)<br />
    {<br />
    object = obj;<br />
    idEvent = nIDEvent;<br />
    elapse = uElapse;<br />
    proc = lpTimerProc;<br />
<br />
    EnterCriticalSection(&lock);<br />
    // is it already active?<br />
    if (isActive)<br />
    {<br />
        LeaveCriticalSection(&lock);<br />
        return 0;<br />
    }<br />
<br />
    // Start the thread<br />
    DWORD threadId;    <br />
    HANDLE threadHandle = CreateThread (NULL, 0, TimerFunction, this, 0, &threadId);    <br />
    SetThreadPriority(threadHandle,THREAD_PRIORITY_TIME_CRITICAL);<br />
    isActive = TRUE;<br />
    LeaveCriticalSection(&lock);<br />
    return nIDEvent;<br />
    }<br />
//END OF CODE


Note that the setup routine resides within a class called CThreadTimer, and a reference to this class is passed to the main thread routine. This hasn't caused me any problems before.

Any ideas?
GeneralRe: Multi-threading problem Pin
John M. Drescher24-Nov-03 5:58
John M. Drescher24-Nov-03 5:58 
GeneralRe: Multi-threading problem Pin
David Crow24-Nov-03 6:00
David Crow24-Nov-03 6:00 
GeneralRe: Multi-threading problem Pin
John M. Drescher24-Nov-03 6:02
John M. Drescher24-Nov-03 6:02 
GeneralRe: Multi-threading problem Pin
BHulme24-Nov-03 6:23
BHulme24-Nov-03 6:23 
GeneralRe: Multi-threading problem Pin
John M. Drescher24-Nov-03 6:30
John M. Drescher24-Nov-03 6:30 
GeneralRe: Multi-threading problem Pin
John M. Drescher24-Nov-03 7:04
John M. Drescher24-Nov-03 7:04 
Generalterminating thread in button on-event Pin
jason9924-Nov-03 4:54
jason9924-Nov-03 4:54 
GeneralRe: terminating thread in button on-event Pin
David Crow24-Nov-03 5:15
David Crow24-Nov-03 5:15 
GeneralRe: terminating thread in button on-event Pin
jason9924-Nov-03 5:25
jason9924-Nov-03 5:25 
GeneralRe: terminating thread in button on-event Pin
David Crow24-Nov-03 5:46
David Crow24-Nov-03 5:46 
GeneralRe: terminating thread in button on-event Pin
valikac24-Nov-03 5:41
valikac24-Nov-03 5:41 
GeneralRe: terminating thread in button on-event Pin
Mike Dimmick24-Nov-03 5:49
Mike Dimmick24-Nov-03 5:49 
GeneralRe: terminating thread in button on-event Pin
David Crow24-Nov-03 5:52
David Crow24-Nov-03 5:52 
GeneralRe: terminating thread in button on-event Pin
Anonymous24-Nov-03 6:54
Anonymous24-Nov-03 6:54 
Generaldoubts with ShellExecuteEx Pin
chadell24-Nov-03 4:37
chadell24-Nov-03 4:37 
GeneralRe: doubts with ShellExecuteEx Pin
David Crow24-Nov-03 5:00
David Crow24-Nov-03 5:00 
GeneralRe: doubts with ShellExecuteEx Pin
chadell24-Nov-03 20:32
chadell24-Nov-03 20:32 

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.