> Fantastic stuff!  This seems to work fine:
>
>                       if(pWebFile != NULL)
>                       {
>                               if( pWebFile->QueryInfoStatusCode(
dwStatusCode ) )
>                               {
>                                       if( dwStatusCode >= 400 &&
> dwStatusCode < 500 )
>                                       {
>                                               // Not found!
>                                               AfxMessageBox(
> IDS_STR_INVALID_URL,
>
> MB_OK|MB_ICONERROR );
>                                       }
>                                       else
>                                       {

Actually, you should check for 20x codes which mean success.  Other status
codes (10x, 30x, 40x, and 50x) all have predefined meanings.  For example if
you get a 503 (Service Unavailable) error code, the above code mistakenly
interprets it as a success.  The best check I can think of is:

 if ((dwStatusCode / 100) == 2)
  /* success */;
 else
  /* failure */;

-------------
Ehsan Akhgari

Farda Technology (http://www.farda-tech.com/)

List Owner: [email protected]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

Freedom from fever is still far from being knowledge! Refrigerated spirits I
do not believe in. He who cannot lie, does not know what truth is.
-Thus Spoke Zarathustra, F. W. Nietzsche




_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to