Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: C++ : pass a string array to LPARAM Pin
Atlence28-Aug-12 10:28
Atlence28-Aug-12 10:28 
QuestionRe: C++ : pass a string array to LPARAM Pin
CPallini28-Aug-12 22:58
mveCPallini28-Aug-12 22:58 
AnswerRe: C++ : pass a string array to LPARAM Pin
Atlence29-Aug-12 7:29
Atlence29-Aug-12 7:29 
AnswerRe: C++ : pass a string array to LPARAM Pin
Stefan_Lang27-Aug-12 23:08
Stefan_Lang27-Aug-12 23:08 
Questionhow to send a slider's value while scrolling.? Pin
mbatra3127-Aug-12 2:41
mbatra3127-Aug-12 2:41 
AnswerRe: how to send a slider's value while scrolling.? Pin
Chris Losinger27-Aug-12 3:18
professionalChris Losinger27-Aug-12 3:18 
AnswerRe: how to send a slider's value while scrolling.? Pin
pasztorpisti27-Aug-12 4:27
pasztorpisti27-Aug-12 4:27 
Questionneed help with vector<student*>* students pointer Pin
neodeaths27-Aug-12 0:28
neodeaths27-Aug-12 0:28 
AnswerRe: need help with vector* students pointer Pin
Maximilien27-Aug-12 0:45
Maximilien27-Aug-12 0:45 
QuestionRe: need help with vector* students pointer Pin
David Crow27-Aug-12 2:34
David Crow27-Aug-12 2:34 
AnswerRe: need help with vector* students pointer Pin
Stefan_Lang27-Aug-12 23:30
Stefan_Lang27-Aug-12 23:30 
Questionfrom sync TCP/IP to async Pin
bkelly1326-Aug-12 15:42
bkelly1326-Aug-12 15:42 
AnswerRe: from sync TCP/IP to async Pin
pasztorpisti26-Aug-12 22:25
pasztorpisti26-Aug-12 22:25 
GeneralRe: from sync TCP/IP to async Pin
bkelly1327-Aug-12 2:41
bkelly1327-Aug-12 2:41 

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.