|
-
April 12th, 2005, 12:30 PM
#1
Hang on send WM_COPYDATA
I want to encapsulate IPC into a dll, so I dont want to import a handle from other window. Instead, I created a window in the dll to receive message, but when i send WM_COPYDATA from other process, the process hung on SendMessage. What's matter?
appreciate for any advice.
BTW: the window I created is CWindow and it's parent is NULL.
endless song
-
April 12th, 2005, 12:59 PM
#2
Re: Hang on send WM_COPYDATA
How are you calling SendMessage ?
-
April 12th, 2005, 07:32 PM
#3
Re: Hang on send WM_COPYDATA
This way.
::SendMessage(hWnd, WM_COPYDATA, (WPARAM)m_hWnd, (LPARAM)©data);
I think the problem is no thread call GetMessage.
but how can i create a thread to call?
endless song
-
April 12th, 2005, 08:10 PM
#4
Re: Hang on send WM_COPYDATA
I am kinda confused. I understand your theory of not having messagepump.. but SendMessage shouldn't be needing the queue at all. It should directly call the wndproc. I am trying to find any info on MSDN that says if it is necessary for a message pump to be there for the wndproc to be called
-
April 12th, 2005, 08:36 PM
#5
Re: Hang on send WM_COPYDATA
When a worker thread sends a message to a window, the SendMessage function queues up the message for the window.
If SendMessage is called from the same thread that owns the window, the message is never queued;
Obviously, I call SendMessage from diffrent thread.
endless song
-
April 13th, 2005, 11:10 AM
#6
Re: Hang on send WM_COPYDATA
As one of the jobs of the dll , you could spawn a thread and create a window and a message pump in it..
BTW, have you thought about other forms of IPC ?
-
April 13th, 2005, 07:59 PM
#7
Re: Hang on send WM_COPYDATA
I have found some other way to do the same thing.
thanks. : )
endless song
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|