Click here to Skip to main content
15,923,164 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFileDialog Pin
Saurabh.Garg25-Apr-08 2:25
Saurabh.Garg25-Apr-08 2:25 
GeneralRe: CFileDialog Pin
Saurabh.Garg25-Apr-08 2:22
Saurabh.Garg25-Apr-08 2:22 
GeneralRe: CFileDialog Pin
Saurabh.Garg24-Apr-08 22:27
Saurabh.Garg24-Apr-08 22:27 
GeneralRe: CFileDialog Pin
Nitheesh George24-Apr-08 22:59
Nitheesh George24-Apr-08 22:59 
QuestionRe: CFileDialog Pin
David Crow25-Apr-08 3:39
David Crow25-Apr-08 3:39 
GeneralRe: CFileDialog Pin
Michael Schubert25-Apr-08 4:40
Michael Schubert25-Apr-08 4:40 
GeneralNeed solution for WSAEWOULDBLOCK Pin
yaminisridaran24-Apr-08 19:49
yaminisridaran24-Apr-08 19:49 
GeneralRe: Need solution for WSAEWOULDBLOCK Pin
Mark Salsbery25-Apr-08 6:14
Mark Salsbery25-Apr-08 6:14 
Has your code changed since I answered this a couple days ago?

If you post code wrapped in pre tags, most of us would be much more
inclined to read it.

It appears you still have the same problem as a couple days ago....
the code is wrong.

You're not using the event properly.

You can simplify your code to something like this (pseudocode):
create/init/connect the socket
WSACreateEvent
WSAEventSelect
while(m_abort)
{
    WaitForEvent
    WSAEnumNetworkEvents  (this will reset the event)
    if read event
    {
        read a datagram, or loop reading datagrams until you get a WSAEWOULDBLOCK error
    }
}

You also probably want another event so you have a way to exit the loop if no data is received...
create/init/connect the socket
create an abort event
WSACreateEvent
WSAEventSelect
while(m_abort)
{
    Wait For socket or abort Event (WaitForMultipleObjects)
    if abort event
    {
        break;
    }
    else
    {
        WSAEnumNetworkEvents  (this will reset the socket event)
        if read event
        {
            read a datagram, or loop reading datagrams until you get a WSAEWOULDBLOCK error
        }
    }
}


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionWhat is the significance of #pragma once ? Pin
SherTeks24-Apr-08 19:26
SherTeks24-Apr-08 19:26 
AnswerRe: What is the significance of #pragma once ? Pin
Mukesh Kumar24-Apr-08 19:46
Mukesh Kumar24-Apr-08 19:46 
AnswerRe: What is the significance of #pragma once ? Pin
ShilpiP24-Apr-08 20:11
ShilpiP24-Apr-08 20:11 
GeneralRe: What is the significance of #pragma once ? Pin
SherTeks24-Apr-08 20:56
SherTeks24-Apr-08 20:56 
GeneralRe: What is the significance of #pragma once ? Pin
Naveen24-Apr-08 21:14
Naveen24-Apr-08 21:14 
GeneralRe: What is the significance of #pragma once ? Pin
SherTeks24-Apr-08 21:30
SherTeks24-Apr-08 21:30 
GeneralRe: What is the significance of #pragma once ? Pin
ShilpiP24-Apr-08 21:54
ShilpiP24-Apr-08 21:54 
GeneralRe: What is the significance of #pragma once ? Pin
Rajkumar R24-Apr-08 21:27
Rajkumar R24-Apr-08 21:27 
AnswerRe: What is the significance of #pragma once ? Pin
peterchen24-Apr-08 21:54
peterchen24-Apr-08 21:54 
AnswerRe: What is the significance of #pragma once ? Pin
David Crow25-Apr-08 3:45
David Crow25-Apr-08 3:45 
GeneralRunning progress bar automatically as the dialogbox is displayed Pin
Le@rner24-Apr-08 19:14
Le@rner24-Apr-08 19:14 
GeneralRe: Running progress bar automatically as the dialogbox is displayed Pin
Naveen24-Apr-08 19:24
Naveen24-Apr-08 19:24 
GeneralRe: Running progress bar automatically as the dialogbox is displayed Pin
Le@rner24-Apr-08 19:44
Le@rner24-Apr-08 19:44 
GeneralRe: Running progress bar automatically as the dialogbox is displayed Pin
Naveen24-Apr-08 19:54
Naveen24-Apr-08 19:54 
GeneralRe: Running progress bar automatically as the dialogbox is displayed Pin
Nitheesh George24-Apr-08 23:11
Nitheesh George24-Apr-08 23:11 
QuestionHow to read a property file in C++ Pin
pl_kode24-Apr-08 19:07
pl_kode24-Apr-08 19:07 
GeneralRe: How to read a property file in C++ Pin
Cedric Moonen24-Apr-08 20:04
Cedric Moonen24-Apr-08 20:04 

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.