Click here to Skip to main content
14,934,103 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Need to read big-endian file (Windows) Pin
Luc Pattyn6-Apr-10 23:31
sitebuilderLuc Pattyn6-Apr-10 23:31 
QuestionAfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
Vaclav_6-Apr-10 14:25
MemberVaclav_6-Apr-10 14:25 
AnswerRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
No Name No Name No Name6-Apr-10 17:56
MemberNo Name No Name No Name6-Apr-10 17:56 
AnswerRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
ramana.g6-Apr-10 18:26
Memberramana.g6-Apr-10 18:26 
GeneralRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
sthalasayanam6-Apr-10 18:43
Membersthalasayanam6-Apr-10 18:43 
AnswerRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
Rajesh R Subramanian7-Apr-10 0:16
professionalRajesh R Subramanian7-Apr-10 0:16 
AnswerRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
David Crow7-Apr-10 3:05
MemberDavid Crow7-Apr-10 3:05 
AnswerRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
Vaclav_7-Apr-10 6:26
MemberVaclav_7-Apr-10 6:26 
Thanks y'all!
I guess I missed it somewhere in documentation that I need the message queue / pump. But I was puzzled why my CWinThread derived class was never constructed.Duh!
But I am beginning to see big flaw in my design - I need to "unload" processing time from the main thread ( I hope that is in English!) so I can click the button to stop my process. But I want to stop this process at specific location , so why am I going thru all this extra code if I can just put a global flag and set it in the worker thread?
What would be the difference between this (flag) and setting an event in worker thread and waiting for it in the main thread as suggested?
(BTW very good suggestion,thanks)

I prefer KISS methods! I was just trying to learn how to communicate between threads for future reference when the task won't be so simple.

Anyway, can someone elaborate on this: if I create worker thread variable in one thread (as I did ) how can I use that variable ( to control the thread as I wanted originaly) from another class ( object )?
Do I need a global variable? How would that appoach differ from my use of simple flag?
But I think I am getting too far into left field of what - if scenario.

Thanks again for all you suggestions, I really appreciate it.
Vaclav

PS Spring is finally here in Texas! Success!
GeneralRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
Vaclav_7-Apr-10 6:36
MemberVaclav_7-Apr-10 6:36 
AnswerRe: AfxBeginThread and ON_THREAD_MESSAGE does not work using PostThreadMessage Pin
Vaclav_7-Apr-10 8:01
MemberVaclav_7-Apr-10 8:01 
QuestionReset to computer Pin
RomTibi6-Apr-10 9:57
MemberRomTibi6-Apr-10 9:57 
QuestionRe: Reset to computer Pin
David Crow6-Apr-10 10:04
MemberDavid Crow6-Apr-10 10:04 
AnswerRe: Reset to computer Pin
RomTibi6-Apr-10 10:24
MemberRomTibi6-Apr-10 10:24 
AnswerRe: Reset to computer Pin
David Crow6-Apr-10 10:26
MemberDavid Crow6-Apr-10 10:26 
GeneralRe: Reset to computer Pin
RomTibi7-Apr-10 5:29
MemberRomTibi7-Apr-10 5:29 
AnswerRe: Reset to computer Pin
Eugen Podsypalnikov6-Apr-10 10:07
MemberEugen Podsypalnikov6-Apr-10 10:07 
GeneralRe: Reset to computer Pin
RomTibi7-Apr-10 5:29
MemberRomTibi7-Apr-10 5:29 
AnswerShutdown -r Pin
gamefreak22916-Apr-10 11:07
Membergamefreak22916-Apr-10 11:07 
GeneralRe: Shutdown -r Pin
RomTibi7-Apr-10 5:30
MemberRomTibi7-Apr-10 5:30 
QuestionVisual C++ Solution in GCC Pin
darc koder6-Apr-10 7:12
Memberdarc koder6-Apr-10 7:12 
AnswerRe: Visual C++ Solution in GCC Pin
Maximilien6-Apr-10 8:57
MemberMaximilien6-Apr-10 8:57 
AnswerRe: Visual C++ Solution in GCC Pin
CPallini6-Apr-10 9:44
mveCPallini6-Apr-10 9:44 
AnswerRe: Visual C++ Solution in GCC Pin
David Crow6-Apr-10 10:07
MemberDavid Crow6-Apr-10 10:07 
QuestionVertical/Horizontal scroll bar not coming in CListCtrl Pin
_T("No name")6-Apr-10 3:45
Member_T("No name")6-Apr-10 3:45 
AnswerRe: Vertical/Horizontal scroll bar not coming in CListCtrl Pin
_T("No name")6-Apr-10 3:50
Member_T("No name")6-Apr-10 3:50 

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.