Click here to Skip to main content
15,920,801 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWM_ENDSESSION Pin
john563226-Mar-08 22:43
john563226-Mar-08 22:43 
QuestionRe: WM_ENDSESSION Pin
CPallini26-Mar-08 23:15
mveCPallini26-Mar-08 23:15 
GeneralRe: WM_ENDSESSION Pin
john563226-Mar-08 23:42
john563226-Mar-08 23:42 
GeneralRe: WM_ENDSESSION Pin
Randor 27-Mar-08 7:52
professional Randor 27-Mar-08 7:52 
GeneralCOM message pump Pin
George_George26-Mar-08 22:18
George_George26-Mar-08 22:18 
GeneralRe: COM message pump Pin
Iain Clarke, Warrior Programmer26-Mar-08 23:09
Iain Clarke, Warrior Programmer26-Mar-08 23:09 
GeneralRe: COM message pump Pin
George_George26-Mar-08 23:43
George_George26-Mar-08 23:43 
AnswerRe: COM message pump Pin
Roger Stoltz27-Mar-08 0:51
Roger Stoltz27-Mar-08 0:51 
George_George wrote:
for general implementation for STA, if the message pump is blocked by STA owning thread, invocation from other apartment to the current STA will be block? Right?


Yes.
Calls from other apartments implies that the interface has to be marshalled.
When the call is made the RPC will send(!) a message to the STA thread. If that STA doesn't pump messages the call will block. This can happen even if the STA has a message pump but the thread is already inside a message handler or doing something else instead of pumping messages.

This is the same problem as sending messages from one thread to another instead of posting them. The difference between sending and posting is that posting doesn't wait until the message is handled, which means that you cannot deadlock when posting messages but you certainly can when sending them.
However, the RPC in this aspect send messages since all calls return a HRESULT which means that it has to wait for the result before it returns to the caller.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: COM message pump Pin
George_George27-Mar-08 2:12
George_George27-Mar-08 2:12 
GeneralRe: COM message pump Pin
Roger Stoltz27-Mar-08 2:38
Roger Stoltz27-Mar-08 2:38 
GeneralRe: COM message pump Pin
George_George27-Mar-08 3:20
George_George27-Mar-08 3:20 
AnswerRe: COM message pump Pin
Roger Stoltz27-Mar-08 22:47
Roger Stoltz27-Mar-08 22:47 
GeneralRe: COM message pump Pin
George_George27-Mar-08 23:38
George_George27-Mar-08 23:38 
GeneralRe: COM message pump Pin
Roger Stoltz28-Mar-08 0:04
Roger Stoltz28-Mar-08 0:04 
GeneralRe: COM message pump Pin
George_George28-Mar-08 0:29
George_George28-Mar-08 0:29 
GeneralRe: COM message pump Pin
Roger Stoltz28-Mar-08 0:53
Roger Stoltz28-Mar-08 0:53 
GeneralRe: COM message pump Pin
George_George28-Mar-08 4:24
George_George28-Mar-08 4:24 
GeneralRe: COM message pump Pin
Roger Stoltz28-Mar-08 4:41
Roger Stoltz28-Mar-08 4:41 
GeneralRe: COM message pump Pin
George_George28-Mar-08 5:05
George_George28-Mar-08 5:05 
GeneralRe: COM message pump Pin
Stephen Hewitt27-Mar-08 15:33
Stephen Hewitt27-Mar-08 15:33 
GeneralRe: COM message pump Pin
Iain Clarke, Warrior Programmer27-Mar-08 22:49
Iain Clarke, Warrior Programmer27-Mar-08 22:49 
GeneralRe: COM message pump Pin
George_George27-Mar-08 23:48
George_George27-Mar-08 23:48 
GeneralProblem in Focusing... Pin
Ashish Chauhan26-Mar-08 21:16
Ashish Chauhan26-Mar-08 21:16 
GeneralRe: Problem in Focusing... Pin
Naveen26-Mar-08 21:49
Naveen26-Mar-08 21:49 
GeneralRe: Problem in Focusing... Pin
Ashish Chauhan26-Mar-08 22:42
Ashish Chauhan26-Mar-08 22:42 

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.