Click here to Skip to main content
14,690,839 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to calculate width and height of different font size ,font style and no of characters ? Pin
shiv@nand2-Apr-10 3:15
Membershiv@nand2-Apr-10 3:15 
GeneralRe: How to calculate width and height of different font size ,font style and no of characters ? Pin
Eugen Podsypalnikov2-Apr-10 3:18
MemberEugen Podsypalnikov2-Apr-10 3:18 
GeneralRe: How to calculate width and height of different font size ,font style and no of characters ? Pin
shiv@nand2-Apr-10 3:25
Membershiv@nand2-Apr-10 3:25 
QuestionCan I export a makefile from Visual Studio? Pin
Aric Wang1-Apr-10 20:04
MemberAric Wang1-Apr-10 20:04 
QuestionWhat is your point, then? Pin
CPallini2-Apr-10 1:10
mveCPallini2-Apr-10 1:10 
QuestionHow to write a function that calls a secondary thread and returns back to the main thread? Pin
eight1-Apr-10 20:03
Membereight1-Apr-10 20:03 
QuestionRe: How to write a function that calls a secondary thread and returns back to the main thread? Pin
Adam Roderick J1-Apr-10 20:27
MemberAdam Roderick J1-Apr-10 20:27 
AnswerRe: How to write a function that calls a secondary thread and returns back to the main thread? Pin
Cedric Moonen1-Apr-10 21:22
MemberCedric Moonen1-Apr-10 21:22 
I think you didn't really understand how threading works. You can't "call" a thread, a thread is running in parallel of your main thread and you cannot call it.
From your example, it looks like you want to do some processing, get the results of the processing when done and display that result, all of that WITHOUT freezing the UI (that's why you want a thread, right) ? Am I correct ?
If yes, then this is not the way to do it: in your Foo function, you are anyway waiting for the result of your thread (thus blocking the main thread), which means that the UI messages won't be processed anymore.
The best way to solve your problem is to start the thread (in your FunctionX for instance) and then post a user defined message containing the result to the UI. I suggest you read this very good article[^] for more information.
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

GeneralRe: How to write a function that calls a secondary thread and returns back to the main thread? Pin
eight1-Apr-10 21:50
Membereight1-Apr-10 21:50 
QuestionLong SMS in PDU mode not Done. Pin
Le@rner1-Apr-10 19:59
MemberLe@rner1-Apr-10 19:59 
QuestionSuspend ShellExcuteEx Pin
Orion Star1-Apr-10 12:06
MemberOrion Star1-Apr-10 12:06 
AnswerRe: Suspend ShellExcuteEx Pin
Richard Andrew x641-Apr-10 12:13
professionalRichard Andrew x641-Apr-10 12:13 
GeneralRe: Suspend ShellExcuteEx Pin
Orion Star2-Apr-10 5:12
MemberOrion Star2-Apr-10 5:12 
GeneralRe: Suspend ShellExcuteEx Pin
Richard Andrew x642-Apr-10 5:53
professionalRichard Andrew x642-Apr-10 5:53 
GeneralRe: Suspend ShellExcuteEx Pin
Orion Star2-Apr-10 6:12
MemberOrion Star2-Apr-10 6:12 
GeneralRe: Suspend ShellExcuteEx Pin
Richard Andrew x642-Apr-10 6:15
professionalRichard Andrew x642-Apr-10 6:15 
GeneralRe: Suspend ShellExcuteEx Pin
Richard Andrew x642-Apr-10 6:35
professionalRichard Andrew x642-Apr-10 6:35 
GeneralRe: Suspend ShellExcuteExd Pin
Orion Star2-Apr-10 10:53
MemberOrion Star2-Apr-10 10:53 
GeneralRe: Suspend ShellExcuteExd Pin
Richard Andrew x642-Apr-10 10:56
professionalRichard Andrew x642-Apr-10 10:56 
GeneralRe: Suspend ShellExcuteExd Pin
Orion Star2-Apr-10 11:09
MemberOrion Star2-Apr-10 11:09 
GeneralRe: Suspend ShellExcuteEx Pin
Orion Star2-Apr-10 10:45
MemberOrion Star2-Apr-10 10:45 
AnswerRe: Suspend ShellExcuteEx Pin
Adam Roderick J1-Apr-10 20:58
MemberAdam Roderick J1-Apr-10 20:58 
GeneralRe: Suspend ShellExcuteEx Pin
Orion Star2-Apr-10 5:13
MemberOrion Star2-Apr-10 5:13 
GeneralRe: Suspend ShellExcuteEx Pin
Adam Roderick J2-Apr-10 6:11
MemberAdam Roderick J2-Apr-10 6:11 
GeneralRe: Suspend ShellExcuteEx Pin
Orion Star2-Apr-10 10:35
MemberOrion Star2-Apr-10 10:35 

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.