Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to send a slider's value while scrolling.? Pin
mbatra3127-Aug-12 2:41
mbatra3127-Aug-12 2:41 
AnswerRe: how to send a slider's value while scrolling.? Pin
Chris Losinger27-Aug-12 3:18
professionalChris Losinger27-Aug-12 3:18 
AnswerRe: how to send a slider's value while scrolling.? Pin
pasztorpisti27-Aug-12 4:27
pasztorpisti27-Aug-12 4:27 
Questionneed help with vector<student*>* students pointer Pin
neodeaths27-Aug-12 0:28
neodeaths27-Aug-12 0:28 
AnswerRe: need help with vector* students pointer Pin
Maximilien27-Aug-12 0:45
Maximilien27-Aug-12 0:45 
QuestionRe: need help with vector* students pointer Pin
David Crow27-Aug-12 2:34
David Crow27-Aug-12 2:34 
AnswerRe: need help with vector* students pointer Pin
Stefan_Lang27-Aug-12 23:30
Stefan_Lang27-Aug-12 23:30 
Questionfrom sync TCP/IP to async Pin
bkelly1326-Aug-12 15:42
bkelly1326-Aug-12 15:42 
Environment: Winows XP Pro, Visual Studio 2008, MFC, C++
Goal: To modify my blocking TCP code that transmitts data to a client to non-blocking or asynchronous operations. The blocking code works, but needs to be changed to async, or to a separate thread, or maybe both, I am uncertain but think that last will be best.

I have been reading the Article: Programming Windows TCP Sockets in C++ for the Beginner
By c_07 and found here:

Programming Windows TCP Sockets in C++ for the Beginner

I think I follow fairly well up through the method definition: int ListenOnPort(int portno)

As I understand it, this is the code for the server to listen for a client to connect and it is blocking. The the author proceeds into the async section and says to put this line of code after the listen() call:

C++
WSAAsyncSelect (s, hwnd, MY_MESSAGE_NOTIFICATION, (FD_ACCEPT | FD_CONNECT |
     FD_READ | FD_CLOSE);
I don't understand how putting a call after the Listen() can transform that call from a blocking call to a non blocking call. I suspect there are more code changes to the server code but I am not unable to recognize what I need to change. I am writing the server part to communicate with a vendor's client application.

Please advise as to what I have missed.

Thank you.
Thanks for your time

AnswerRe: from sync TCP/IP to async Pin
pasztorpisti26-Aug-12 22:25
pasztorpisti26-Aug-12 22:25 
GeneralRe: from sync TCP/IP to async Pin
bkelly1327-Aug-12 2:41
bkelly1327-Aug-12 2:41 
GeneralRe: from sync TCP/IP to async Pin
pasztorpisti27-Aug-12 4:24
pasztorpisti27-Aug-12 4:24 
GeneralRe: from sync TCP/IP to async Pin
jschell27-Aug-12 8:24
jschell27-Aug-12 8:24 
QuestionAccessing extra keys on a PS2 mouse without driver Pin
David Gvozdenovic26-Aug-12 4:57
David Gvozdenovic26-Aug-12 4:57 
AnswerRe: Accessing extra keys on a PS2 mouse without driver Pin
pasztorpisti26-Aug-12 5:41
pasztorpisti26-Aug-12 5:41 
QuestionCreateProcess and Detect when tthis process Ends.. Pin
Drakesal26-Aug-12 1:25
Drakesal26-Aug-12 1:25 
AnswerRe: CreateProcess and Detect when tthis process Ends.. Pin
pasztorpisti26-Aug-12 3:18
pasztorpisti26-Aug-12 3:18 
AnswerRe: CreateProcess and Detect when tthis process Ends.. Pin
Stephen Hewitt26-Aug-12 5:01
Stephen Hewitt26-Aug-12 5:01 
GeneralRe: CreateProcess and Detect when tthis process Ends.. Pin
Drakesal26-Aug-12 21:07
Drakesal26-Aug-12 21:07 
QuestionConvet Perl regular expression to equivalent ECMAScript regular expression Pin
Falconapollo25-Aug-12 18:49
Falconapollo25-Aug-12 18:49 
Questionexception caused by reference to certain Windows functions Pin
ed welch24-Aug-12 6:12
ed welch24-Aug-12 6:12 
AnswerRe: exception caused by reference to certain Windows functions Pin
pasztorpisti24-Aug-12 9:47
pasztorpisti24-Aug-12 9:47 
AnswerRe: exception caused by reference to certain Windows functions Pin
Stephen Hewitt24-Aug-12 21:15
Stephen Hewitt24-Aug-12 21:15 
GeneralRe: exception caused by reference to certain Windows functions Pin
ed welch25-Aug-12 2:11
ed welch25-Aug-12 2:11 
GeneralRe: exception caused by reference to certain Windows functions Pin
Richard MacCutchan25-Aug-12 4:21
mveRichard MacCutchan25-Aug-12 4:21 
GeneralRe: exception caused by reference to certain Windows functions Pin
ed welch25-Aug-12 5:33
ed welch25-Aug-12 5:33 

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.