URLDownloadToFile and IHttpNegotiate::OnResponse

Visual Studio44
Hi



I've adapted a CodeProject sample (here: www.codeproject.com/internet/urldownload.asp)

illustating the use of URLDownloadToFile which is working very nicely

indeed.



One problem I've come across is that I need to somehow retrieve both

the HTTP response code and parse the response headers to get the MIME

type of the file I've just downloaded.



After trawling through MSDN I discovered the IHttpNegotiate interface.



I thought it would be as simple as extending my

CBindStatusCallbackImpl class (which currently derives from and

implements IBindStatusCallback) to derive from IHttpNegotiate also,

and to override the OnResponse method. But alas, when I debug the

application my OnResponse callback never seems to be hit.



I'm just wondering if this is the correct way of getting the response

code and headers?

Or will I have to write a full implementation of IBindStatusCallback

myself to store the file, rather than using the elegant

URLDownloadToFile?



Any help would be greatly appreciated.



Cheers,

Dave.


-