Click here to Skip to main content
15,907,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionfunny with boost::tribool Pin
Robin Imrie29-Aug-12 6:44
professionalRobin Imrie29-Aug-12 6:44 
AnswerRe: funny with boost::tribool (modified) Pin
Chris Meech29-Aug-12 7:14
Chris Meech29-Aug-12 7:14 
GeneralRe: funny with boost::tribool (modified) Pin
Robin Imrie30-Aug-12 2:31
professionalRobin Imrie30-Aug-12 2:31 
GeneralRe: funny with boost::tribool (modified) Pin
Chris Meech30-Aug-12 3:16
Chris Meech30-Aug-12 3:16 
GeneralRe: funny with boost::tribool Pin
CPallini29-Aug-12 11:09
mveCPallini29-Aug-12 11:09 
GeneralRe: funny with boost::tribool Pin
Robin Imrie30-Aug-12 23:28
professionalRobin Imrie30-Aug-12 23:28 
GeneralRe: funny with boost::tribool Pin
Chris Meech31-Aug-12 2:16
Chris Meech31-Aug-12 2:16 
Questionhow to share data between two dlls.? Pin
mbatra3128-Aug-12 1:08
mbatra3128-Aug-12 1:08 
AnswerRe: how to share data between two dlls.? Pin
Maximilien28-Aug-12 3:06
Maximilien28-Aug-12 3:06 
GeneralRe: how to share data between two dlls.? Pin
mbatra3128-Aug-12 19:30
mbatra3128-Aug-12 19:30 
QuestionIs it possible to use std::wstring parameter type in DLL? Pin
Falconapollo27-Aug-12 23:57
Falconapollo27-Aug-12 23:57 
AnswerRe: Is it possible to use std::wstring parameter type in DLL? Pin
CPallini28-Aug-12 0:29
mveCPallini28-Aug-12 0:29 
AnswerRe: Is it possible to use std::wstring parameter type in DLL? Pin
Richard MacCutchan28-Aug-12 7:41
mveRichard MacCutchan28-Aug-12 7:41 
QuestionIPreviewHandler generate BEX error Pin
Le@rner27-Aug-12 22:19
Le@rner27-Aug-12 22:19 
QuestionSending preformed UDP Packets to localhost with C++ Pin
Member 936259727-Aug-12 12:31
Member 936259727-Aug-12 12:31 
QuestionC++ : pass a string array to LPARAM Pin
Atlence27-Aug-12 6:57
Atlence27-Aug-12 6:57 
AnswerRe: C++ : pass a string array to LPARAM Pin
Richard MacCutchan27-Aug-12 7:17
mveRichard MacCutchan27-Aug-12 7:17 
GeneralRe: C++ : pass a string array to LPARAM Pin
Atlence27-Aug-12 11:07
Atlence27-Aug-12 11:07 
GeneralRe: C++ : pass a string array to LPARAM Pin
Richard MacCutchan27-Aug-12 21:24
mveRichard MacCutchan27-Aug-12 21:24 
AnswerRe: C++ : pass a string array to LPARAM Pin
Maximilien27-Aug-12 9:22
Maximilien27-Aug-12 9:22 
AnswerRe: C++ : pass a string array to LPARAM Pin
CPallini27-Aug-12 9:43
mveCPallini27-Aug-12 9:43 
GeneralRe: C++ : pass a string array to LPARAM Pin
pasztorpisti27-Aug-12 10:32
pasztorpisti27-Aug-12 10:32 
It might not be obvious for the OP that myList is either declared somewhere in a persistent location (and not on the stack) when using PostMessage(), or it can be on the stack as a temporary object but in that case SendMessage() must be used instead of PostMessage() and the message handler code must copy the contents of the list object because it might run out of scope after the message processor function returns. A perfect solution though and it shows that anything can be passed to the gui thread as a parameter.

The difference between SendMessage() and PostMessage() is that both functions put a message on the queue of the window to process but SendMessage() blocks the calling thread until the message is processed on the gui thread. If you use PostMessage() then the message is placed on the queue and your PostMessage() call returns immediately and this means that the stack object probably runs out of scope and the pointer parameter associated with the message will be invalid at the time the other thread processes the message.
GeneralRe: C++ : pass a string array to LPARAM Pin
CPallini27-Aug-12 21:10
mveCPallini27-Aug-12 21:10 
GeneralRe: C++ : pass a string array to LPARAM Pin
Atlence28-Aug-12 9:02
Atlence28-Aug-12 9:02 
QuestionRe: C++ : pass a string array to LPARAM Pin
CPallini28-Aug-12 9:59
mveCPallini28-Aug-12 9:59 

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.