URLAccess kURLDisplayProgressFlag issue
URLAccess kURLDisplayProgressFlag issue
- Subject: URLAccess kURLDisplayProgressFlag issue
- From: Richard <email@hidden>
- Date: Sat, 03 May 2003 22:34:09 +1000
- Organization: Faraday R&D
URLOpen has to be used differently from the other methods,
as it is an asynchronous call. This means you have to read the
returned data in the call-back function which you have not supplied
in your example. I use URLOpen myself and that I use my own
progress indicator supplied with data via the call-back.
My code does set kURLDipslayProgressFlag and I still
do _not_ get the Apple supplied progress window.
However I would have to recheck the docs again to make
sure I am not violating some other precondition for
it to work.
Having said that, getting URLOpen to work reliably beyond
just toy examples is extremely challenging, due to many
bugs and much undocumented behaviour.
>
>
Well - I had read that one but it didn't help much at the time.
>
>
There is below my code modified that replaces URLDownload() by
>
URLOpen() with kURLDisplayProgressFlag - we go thru without any error
>
but it just returns immediatly to the caller: to me no download + no
>
progress dialog is worse than download but no progress dialog.
>
>
There is the code: am I missing anything important?
>
>
status = URLNewReference((Ptr) urlstr,&urlref);
>
>
if(status == noErr) {
>
status = URLGetCurrentState(urlref,&urlstate);
>
>
if(urlstate == kURLNullState) {
>
status = URLOpen(urlref,&fsspec,kURLDisplayProgressFlag,NULL,0,NULL);
>
>
if(status != noErr) {
>
status = URLGetError(urlref,&urlerror);
>
}
>
}
>
>
URLDisposeReference(urlref);
>
}
>
>
This is about downloading a file and URLOpen() returns immediatly with
>
a noErr status.
>
>
Best regards
>
>
Patrick Perroud
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.