postmessage函数的帮助(Remarks部分)(50分)

W

wzsaibo

Unregistered / Unconfirmed
GUEST, unregistred user!
Remarks
Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage
function to obtain a unique message for inter-application communication.
If you send a message in the range below WM_USER to the asynchronous message functions (PostMessage,
SendNotifyMessage, and SendMessageCallback), make sure that the message parametersdo
not include
pointers. Otherwise, the functions will return before the receiving thread has had a chance to process
the message and the sender will free the memory before it is used.
 
M

majorsoft

Unregistered / Unconfirmed
GUEST, unregistred user!
备注
使用HWND_BROADCAST进行通讯的应用必须用RegisterWindowMessage函数获得一个唯一的
交互应用的通讯的消息。
 
M

majorsoft

Unregistered / Unconfirmed
GUEST, unregistred user!
如果发送的消息在WM_USER到异步消息函数(PostMessage,
SendNotifyMessage, and SendMessageCallback)返回值(ps:我猜的)之间,你要确保消息参数不包含指针,否则,在接受线程获得机会处理消息之前,发送者将会在消息使用之前释放内存,这个函数就会返回了。
最后一句翻译的不是很顺,希望各位指正!
 
W

wzsaibo

Unregistered / Unconfirmed
GUEST, unregistred user!
谢谢,高手有不同意见吗?
 
Y

yee_jh

Unregistered / Unconfirmed
GUEST, unregistred user!
如果要发送一个值小于WM_USER的消息到异步消息函数(PostMessage,
SendNotifyMessage, and SendMessageCallback),则必须确保此消息参数不包含指针。否则,该消息函数在接受线程还未来得及处理时已返回,也就是说消息的发送者在它未使用内存时就释放内存了。
 
W

wzsaibo

Unregistered / Unconfirmed
GUEST, unregistred user!
多人接受答案了。
 

Similar threads

I
回复
0
查看
2K
import
I
I
回复
0
查看
623
import
I
I
回复
0
查看
3K
import
I
I
回复
0
查看
2K
import
I
顶部