Re: WM_COPYDATA ... what's inside?



..rhavin grobert wrote:
After reading something about WM_COPYDATA, i'm still unshure if i
should use it...

The question is: what does it do? M$ doesnt explaint this very well
(as expected ;-), so i see two possible ways how it is done:

#1 SendMessage(WM_COPYDATA, ...) copies the data in an internal buffer
and POSTS the message to the destination 'while' it returns (so it is
some kind of PostMessage anyway).

#2 SendMessage(WM_COPYDATA, ...) SENDS the pointer to the data or the
pointer to an internal copy of the data to the destination and returns
AFTER the message was processed (whitch would render it pretty useless
for me;-).

if #1 is true it would be easy to implement #2 atop of it, but if #2
is true, it would be completely useless for me, so perhaps someone
could please answer this...

..rhavin:

It's more like 2. Like any SendMessage() it does not return until the receiver has handled the message. But why is this bad for you? If you want, your receiver can copy the data, post a message to itself, and return immediately. The actual work can be done in the PostMessage() handler.

--
David Wilkinson
Visual C++ MVP
.



Relevant Pages

  • Re: [PATCH REPOST^3] Run IST traps from user mode preemptive on process stack
    ... The IST stack pointer is elevated unconditionaly and with your ... change we can now schedule away in the handler. ... The IST pointer in the _TSS_ can go out of bounds by your patch! ... The bug you introduce is that if the handler schedules away (it blocks ...
    (Linux-Kernel)
  • Re: Matching Event Handlers in an Interface
    ... It loops through the sender events and tries to ... > methods from the receiver that match the pattern. ... > either adds or removes a handler for the event. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Memory leakage in BHO
    ... handler - in my case it is a form submit handler. ... Here class FormSubmitSink inherited from IDispatch. ... you seem to store such un-AddRef'ed pointer in a VARIANT. ...
    (microsoft.public.vc.atl)
  • Re: DLL Hell - gracefull handling/app termination
    ... > I am writing a Win32 DLL. ... by using an error handler of sorts. ... So, faced with a pointer p, one ... You can use what is called structured exception handling ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Wont work without useless declarations
    ... seems to be useless as ktop and kbot are never used. ... OP passes the address of the uninitialized pointer k ... fflushis useless, ...
    (comp.lang.c)