Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: stop scrolling of first column in CListView / CListCtrl Pin
Michael Dunn6-Mar-07 12:29
sitebuilderMichael Dunn6-Mar-07 12:29 
Questionpush_back ina vector - Not working for me Pin
LCI6-Mar-07 7:00
LCI6-Mar-07 7:00 
AnswerRe: push_back ina vector - Not working for me Pin
Maximilien6-Mar-07 7:30
Maximilien6-Mar-07 7:30 
GeneralRe: push_back ina vector - Not working for me Pin
LCI6-Mar-07 7:35
LCI6-Mar-07 7:35 
GeneralRe: push_back ina vector - Not working for me Pin
LCI6-Mar-07 7:46
LCI6-Mar-07 7:46 
GeneralRe: push_back ina vector - Not working for me Pin
CPallini6-Mar-07 9:53
mveCPallini6-Mar-07 9:53 
QuestionAsynchrounous sockets doubts Pin
Alex Cutovoi6-Mar-07 6:52
Alex Cutovoi6-Mar-07 6:52 
AnswerRe: Asynchrounous sockets doubts Pin
Mark Salsbery6-Mar-07 15:10
Mark Salsbery6-Mar-07 15:10 
Alex Cutovoi wrote:
The SendData and RecieveData funcs that contains send and recv funcs respectively, needs to be in a thread for that FD_READ and FD_WRITE messages will be sended?


Since you've used WSAAsyncSelect() specifying the FD_READ and FD_WRITE flags you will be notified
when there is data available to be read from the socket and when the socket is ready to accept
send data. This notification will be in the form of a window message (WM_ASYNCMSG) so you could
send/recv data on the UI htread that processes this message. You can also send/recv on other
threads. Just make sure you use some form of synchronization - sockets ops are not thread safe.

Alex Cutovoi wrote:
In the ConnectToServer func, when I start the server and the client app, I've received WSAEWOULDBLOCK message. If I call this funcition again I receive the WSAEISCONN message. This means that my socket is connected? If so, why I receive the WSAEWOULDBLOCK message first?


WSAEWOULDBLOCK indicates that an asynchronous socket operation has started but didn't complete
immediately. If you want to be notified when a connect() call completes then you should add the
FD_CONNECT flag to your WSAAsyncSelect() flags.

Alex Cutovoi wrote:
In some sites that I've readed some tutorials, they say that, in the FD_WRITE message I need to have some caution because this message is sent when there are more space in the buffer with which to write data. Can someone explains tis to me?


Read the details of using FD_WRITE carefully in the docs. From WSAAsyncSelect() -
"The FD_WRITE event is handled slightly differently. An FD_WRITE message is posted when a socket
is first connected with connect or WSAConnect (after FD_CONNECT, if also registered) or accepted
with accept or WSAAccept, and then after a send operation fails with WSAEWOULDBLOCK and buffer
space becomes available. Therefore, an application can assume that sends are possible starting
from the first FD_WRITE message and lasting until a send returns WSAEWOULDBLOCK. After such a
failure the application will be notified that sends are again possible with an FD_WRITE message.
"

Always check the return code on send() and recv() calls to make sure the number of bytes requested
were actually sent or received. A send() or recv() is successful even if only ONE byte gets sent
or received. You'll need to be ready to send remaining unsent bytes and/or receive remaining
unreceived bytes.




"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")

GeneralRe: Asynchrounous sockets doubts Pin
Alex Cutovoi7-Mar-07 3:15
Alex Cutovoi7-Mar-07 3:15 
GeneralRe: Asynchrounous sockets doubts Pin
Mark Salsbery7-Mar-07 4:25
Mark Salsbery7-Mar-07 4:25 
GeneralRe: Asynchrounous sockets doubts Pin
Alex Cutovoi7-Mar-07 5:06
Alex Cutovoi7-Mar-07 5:06 
GeneralRe: Asynchrounous sockets doubts Pin
Mark Salsbery7-Mar-07 5:22
Mark Salsbery7-Mar-07 5:22 
GeneralRe: Asynchrounous sockets doubts Pin
Alex Cutovoi7-Mar-07 6:16
Alex Cutovoi7-Mar-07 6:16 
QuestionCapture specific area on screen... Pin
priyank_ldce6-Mar-07 5:31
priyank_ldce6-Mar-07 5:31 
AnswerRe: Capture specific area on screen... Pin
Ravi Bhavnani6-Mar-07 5:34
professionalRavi Bhavnani6-Mar-07 5:34 
GeneralRe: Capture specific area on screen... Pin
priyank_ldce6-Mar-07 6:12
priyank_ldce6-Mar-07 6:12 
GeneralRe: Capture specific area on screen... Pin
Ravi Bhavnani6-Mar-07 6:16
professionalRavi Bhavnani6-Mar-07 6:16 
GeneralRe: Capture specific area on screen... Pin
Blake Miller6-Mar-07 6:44
Blake Miller6-Mar-07 6:44 
AnswerRe: Capture specific area on screen... Pin
Mark Salsbery6-Mar-07 15:13
Mark Salsbery6-Mar-07 15:13 
QuestionHow to show tool tip help for tool bar items? Pin
Aryan S6-Mar-07 5:14
Aryan S6-Mar-07 5:14 
AnswerRe: How to show tool tip help for tool bar items? Pin
led mike6-Mar-07 5:28
led mike6-Mar-07 5:28 
AnswerRe: How to show tool tip help for tool bar items? Pin
Ravi Bhavnani6-Mar-07 5:33
professionalRavi Bhavnani6-Mar-07 5:33 
QuestionReal Time Application - Server Socket Pin
ScotDolan6-Mar-07 4:45
ScotDolan6-Mar-07 4:45 
AnswerRe: Real Time Application - Server Socket Pin
led mike6-Mar-07 4:53
led mike6-Mar-07 4:53 
GeneralRe: Real Time Application - Server Socket Pin
Ravi Bhavnani6-Mar-07 5:36
professionalRavi Bhavnani6-Mar-07 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.