Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: veryurgent : perfect tool to convert coff format lib to omf format Pin
rjkg20-Jun-07 2:20
rjkg20-Jun-07 2:20 
AnswerRe: veryurgent : perfect tool to convert coff format lib to omf format Pin
Mark Salsbery20-Jun-07 5:40
Mark Salsbery20-Jun-07 5:40 
JokeRe: veryurgent : perfect tool to convert coff format lib to omf format Pin
Hamid_RT20-Jun-07 9:24
Hamid_RT20-Jun-07 9:24 
GeneralRe: veryurgent : perfect tool to convert coff format lib to omf format Pin
Mark Salsbery20-Jun-07 9:26
Mark Salsbery20-Jun-07 9:26 
QuestionCSocket stoping in PumpMessage (please help) Pin
tomitron20-Jun-07 1:55
tomitron20-Jun-07 1:55 
AnswerRe: CSocket stoping in PumpMessage (please help) Pin
Matthew Faithfull20-Jun-07 2:53
Matthew Faithfull20-Jun-07 2:53 
AnswerRe: CSocket stoping in PumpMessage (please help) Pin
Mike Dimmick20-Jun-07 3:44
Mike Dimmick20-Jun-07 3:44 
AnswerRe: CSocket stoping in PumpMessage (please help) Pin
Roger Stoltz20-Jun-07 4:29
Roger Stoltz20-Jun-07 4:29 
I've written quite a few networking applications using MFC and found two unbreakable rules:
  1. Never use CSocket! Use CAsyncSocket.
  2. If the application is multithreaded, all threads that create sockets must be UI-threads since it has to pump messages.

While Matthew and Mike recommends a complete rewrite, I think it would be sufficient to go by the guidelines above and it will probably save a lot of time.
The article Mike linked to is very good and points out important flaws in the design of the socket wrapper classes of MFC. In my experience though, if you adhere to the above, your biggest problem would be a slow DNS lookup.

The part in the article about deriving from both CWnd and CAsyncSocket does not, in my opinion, make any sense. What kind of object is both a window and a socket?
However, you may have a window that contains a socket, or in my case at least a UI-thread.

Another interesting article about MFC socket implementation can be found here[^].
It points out serious flaws in the way MSDN advices developers to write networking applications.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: CSocket stoping in PumpMessage (please help) Pin
led mike20-Jun-07 5:28
led mike20-Jun-07 5:28 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
Roger Stoltz20-Jun-07 6:21
Roger Stoltz20-Jun-07 6:21 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
led mike20-Jun-07 6:32
led mike20-Jun-07 6:32 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
Roger Stoltz20-Jun-07 6:57
Roger Stoltz20-Jun-07 6:57 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
led mike20-Jun-07 8:43
led mike20-Jun-07 8:43 
AnswerRe: CSocket stoping in PumpMessage (please help) Pin
tomitron20-Jun-07 5:44
tomitron20-Jun-07 5:44 
AnswerRe: CSocket stoping in PumpMessage (please help) Pin
tomitron21-Jun-07 1:38
tomitron21-Jun-07 1:38 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
tomitron21-Jun-07 1:41
tomitron21-Jun-07 1:41 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
Roger Stoltz21-Jun-07 3:38
Roger Stoltz21-Jun-07 3:38 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
tomitron21-Jun-07 5:33
tomitron21-Jun-07 5:33 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
Roger Stoltz22-Jun-07 1:05
Roger Stoltz22-Jun-07 1:05 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
Mike O'Neill6-Jul-07 14:07
Mike O'Neill6-Jul-07 14:07 
GeneralRe: CSocket stoping in PumpMessage (please help) Pin
tomitron6-Jul-07 14:52
tomitron6-Jul-07 14:52 
QuestionProblem with Xp Styles Pin
TobetheWinner20-Jun-07 1:55
TobetheWinner20-Jun-07 1:55 
AnswerRe: Problem with Xp Styles Pin
toxcct20-Jun-07 1:57
toxcct20-Jun-07 1:57 
QuestionRe: Problem with Xp Styles Pin
TobetheWinner20-Jun-07 8:09
TobetheWinner20-Jun-07 8:09 
AnswerRe: Problem with Xp Styles Pin
Hamid_RT20-Jun-07 9:19
Hamid_RT20-Jun-07 9:19 

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.