Forget my question.  I have decided to include the status code value in the
message box.  So when they contact me (if they do) I can tell them what it
means from the status code (I assume).

Andrew

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Truckle, Andrew J
> Sent: 16 March 2005 07:34
> To: '[email protected]'
> Subject: RE: [msvc] How do I validate a URL link?
> 
> 
> > 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 */;
> 
> Thanks for that tweak to the code.
> 
> Question:
> 
> When I try to OpenURL, I put it in a TRY block, so if there 
> was a problem, like no internet connection, it gets caught 
> and the user notified of the error message.
> 
> But if that call is OK and we end up with a valid CHttpFile 
> pointer, we then check the status as mentioned.
> 
> What I am getting at concerns the "failure"...
> 
> At the moment I just say:
> 
> "Unable to download information file.
> 
> Contact software author."
> 
> But should I maybe be showing some other text string, based 
> on the value of the status code, and if so, is this system 
> generated at all?
> 
> Andrew
> 
> This email and any attached files are confidential and 
> copyright protected. If you are not the addressee, any 
> dissemination of this communication is strictly prohibited. 
> Unless otherwise expressly agreed in writing, nothing stated 
> in this communication shall be legally binding.
> 
> _______________________________________________
> msvc mailing list
> [email protected]
> See 
> http://beginthread.com/mailman/listinfo/msvc_beginthread.com 
> for subscription changes, and list archive.
> 
> 
> This message has been scanned for viruses by MailControl - 
> (see http://bluepages.wsatkins.co.uk/?4318150)
> 

This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.

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

Reply via email to