-
March 9th, 2007, 06:50 AM
#1
SendMessage Function
Actually i am having a list control in that list control i having 2 columns one contaning url value n other for displaying result....
this i have done through making a class for ping which is derieved from CWinThread class...
if i run a single class then the result displayed in the list control column is correct but instead if i select more than 1 value then the result displayed is same (both rows contain same value). But the value calculated for ping is correct..problem is in displaying it in listctrl..
for sending messeage i have used SendMessage function .
Can anybody help me in this...
thanks in advance
-
March 9th, 2007, 07:49 AM
#2
Re: SendMessage Function
Please post parts of your code containing the problem. Use code tags when posting code.
Time is fun when you're having flies
-
March 9th, 2007, 05:21 PM
#3
Re: SendMessage Function
If you're working with threads, you should use PostMessage, not SendMessage. SendMessage executes in the same thread as the thread it was called in (from). MFC objects are not valid across threads. Also, with SendMessage you run the risk of a deadlock situation (the message you are sending depends on something in the function that sends the message).
Viggy
-
March 9th, 2007, 07:25 PM
#4
Re: SendMessage Function
Originally Posted by MrViggy
SendMessage executes in the same thread as the thread it was called in (from).
That's true, but the real reason not to use SendMessage for inter-thread communication, is that although SendMessage executes in the thread it was called from, the actual message itself is handled in the thread that created the recipient window.
Mike
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
|