Click here to Skip to main content
16,005,037 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC Exntension-DLL Resource-Access question Pin
Blake Miller6-May-04 8:18
Blake Miller6-May-04 8:18 
GeneralConvert HDC to long Pin
Kannan Kalyanaraman4-May-04 3:00
Kannan Kalyanaraman4-May-04 3:00 
GeneralRe: Convert HDC to long Pin
Anonymous4-May-04 3:12
Anonymous4-May-04 3:12 
GeneralRe: Convert HDC to long Pin
Kannan Kalyanaraman4-May-04 3:35
Kannan Kalyanaraman4-May-04 3:35 
GeneralO.O All my knowledge about asynchronous sockets and message pumps broken.. help.. Pin
Kuniva4-May-04 2:09
Kuniva4-May-04 2:09 
GeneralRe: O.O All my knowledge about asynchronous sockets and message pumps broken.. help.. Pin
Kuniva4-May-04 2:15
Kuniva4-May-04 2:15 
GeneralRe: O.O All my knowledge about asynchronous sockets and message pumps broken.. help.. Pin
Mike Dimmick4-May-04 5:14
Mike Dimmick4-May-04 5:14 
GeneralRe: O.O All my knowledge about asynchronous sockets and message pumps broken.. help.. Pin
Kuniva4-May-04 8:11
Kuniva4-May-04 8:11 
Uhm, thank you for this explanation, i had read before that the Socket classes from MFC were considered to be a bit faulty, but never knew they were considered broken.. hmm. And i have read the Winsock Programmer's FAQ already more than once Wink | ;) . I know my way around the Winsock API, just not MFC..
What is very interesting is this message pump of the MessageBox, i'm afraid i don't quite understand.. I mean, if the messagebox is a modal dialog and it has it's own message pump, what difference does it make? As long as the messagebox is displayed the message pump of the main dialog is still frozen and cannot process messages isn't it? If you could explain, because it is still bugging me...

Another thing i would like to mention for everyone who ever ran into the same program is this: I was able to fix my problem by Switching the socket into blocking mode at the start of my OnReceive method like this:
DWORD dw = (DWORD)0;

m_hSocket.AsyncSelect(0);
m_hSocket.IOCtl(FIONBIO,&dw);


And switching it back to asynchronous mode like this:
if(m_hSocket!=INVALID_SOCKET)
    m_hSocket.AsyncSelect(FD_CLOSE | FD_CONNECT | FD_READ | FD_WRITE);


The condition is just there because if certain data is received i might call Close() on the socket and if u try AsyncSelect() after a Close() u get an assertion failure.

Thank you very much for your reply.

Kuniva
--------------------------------------------
GeneralRe: O.O All my knowledge about asynchronous sockets and message pumps broken.. help.. Pin
Mike Dimmick4-May-04 12:11
Mike Dimmick4-May-04 12:11 
GeneralCFile size in bytes Pin
Jamie Kenyon4-May-04 2:02
Jamie Kenyon4-May-04 2:02 
GeneralRe: CFile size in bytes Pin
David Crow4-May-04 2:16
David Crow4-May-04 2:16 
GeneralRe: CFile size in bytes Pin
andyxia4-May-04 2:33
andyxia4-May-04 2:33 
GeneralRe: CFile size in bytes Pin
Alexander M.,4-May-04 3:18
Alexander M.,4-May-04 3:18 
GeneralRe: CFile size in bytes Pin
Jamie Kenyon4-May-04 4:50
Jamie Kenyon4-May-04 4:50 
QuestionSetDIBitsToDevice causes image to flip, why? Pin
uus994-May-04 2:02
uus994-May-04 2:02 
AnswerRe: SetDIBitsToDevice causes image to flip, why? Pin
Monty24-May-04 2:15
Monty24-May-04 2:15 
GeneralRe: SetDIBitsToDevice causes image to flip, why? Pin
uus994-May-04 2:27
uus994-May-04 2:27 
GeneralC2440: 'static_cast' Error Pin
sweep1234-May-04 1:51
sweep1234-May-04 1:51 
GeneralRe: C2440: 'static_cast' Error Pin
Mike Dimmick4-May-04 5:17
Mike Dimmick4-May-04 5:17 
GeneralRe: C2440: 'static_cast' Error Pin
sweep1234-May-04 5:56
sweep1234-May-04 5:56 
GeneralFile drag/drop problem, waiting for your help! Pin
andyxia4-May-04 1:21
andyxia4-May-04 1:21 
GeneralHook in dll Pin
yingkou4-May-04 0:31
yingkou4-May-04 0:31 
GeneralRe: Hook in dll Pin
Monty24-May-04 1:44
Monty24-May-04 1:44 
GeneralObj to Source file Pin
Gurou4-May-04 0:29
Gurou4-May-04 0:29 
GeneralRe: Obj to Source file Pin
toxcct4-May-04 0:46
toxcct4-May-04 0:46 

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.