Re: message pump code for COM STA

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi George,

My question is not how CreateWindow/RegisterClass/WNDPROC works, but
who is responsible to write WNDPROC and register it in the case of
STA message pump for the handler for the hidden window? The question
is which party does this. I think COM Runtime does this during
CoInitialize(), right?

Yes.

Why do you ask the same questions over and over again. Igor answered this
question in "C++ COM STA model" on 24th of march. See below.

"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:25E267B5-0538-437B-9788-AFEDB2EC2BDB@xxxxxxxxxxxxx
In COM STA model, a hidden Window will be created with synchronized
message pump operation.

Not quite. COM will create a hidden window. Your thread is responsible
for pumping messages to it (except in certain situations where COM
enters a modal message pump, e.g. when you make an out-of-apartment COM
call).

1. Who (which party) is responsible for generating code to create the
hidden Window

COM creates a hidden window in CoInitialize. I'm not sure what you mean
by "generating code".

--
SvenC
.



Relevant Pages

  • Re: C++ COM STA model
    ... COM will create a hidden window. ... for pumping messages to it (except in certain situations where COM ... enters a modal message pump, e.g. when you make an out-of-apartment COM ... COM creates a hidden window in CoInitialize. ...
    (microsoft.public.vc.language)
  • unknown message to hidden window
    ... I have an ATL server with a hidden window created in a thread proc. ... thread proc is also the message pump. ... I log all posted messages that ...
    (microsoft.public.vc.atl)
  • Re: CAsyncSocket in service
    ... hidden window (to which socket notification messages are posted) in order to ... CAsyncSocket cannot be used in a thread that has no message pump. ...
    (microsoft.public.vc.mfc)
  • Re: Batch file and MFC (Properly Terminating Application)
    ... to close a program except at the user's request, which means the handler is a direct ... descendant of the top-level message pump, I never worry about cases like this. ... the changes the user thought had been made--because the app closed without ... user clicks on Cancel button and application exits. ...
    (microsoft.public.vc.mfc)
  • Re: Cant Move Overlapped Window to Front
    ... I know that my message pump is working -- when I ... my OnPaint() handler executes and I ... can see the updates in the portion of my window not obscured by other ...
    (microsoft.public.vc.mfc)