'self-signed'에 해당되는 글 1건
URLDownloadToFile with IBindStatusCallback and IHTTPSecurity

The last parameter of URLDownloadToFile and URLDownloadToCacheFile API is the pointer of IBindStatusCallback.
This paramter is optional, so you can just set NULL; however, in my experience, you have to implement IBindStatusCallback in many cases.
class CBindStatusCallback : public IBindStatusCallback , public IHttpSecurity ///// IUnknown methods STDMETHOD_(ULONG,Release)() STDMETHOD(QueryInterface)(
|
- Implement IUnknown interface
- AddRef, Relase Method
- You can implement this function according to official rule, but there is trick.
- You can make this object local variable, then you don't need to worry about it's lifetime.
- return non-zero value: it means this object will not be destroyed.
- QueryInterface Method
- Implement IBindStatusCallback interface
- You don't need to implement every method; you can actually write 'return E_NOTIMPL' in almost cases.
- GetBindInfo method has crucial role.
- You can set a code page.
- If there is non English character in URL, it can be an issue depending on the OS language setting.
- Also, You can set several options.
- Implement IHttpSecurity interface
- You can download files even though the sever has some security problems such as a self-signed certificate.
HRESULT CBindStatusCallback::QueryInterface( if( IID_IUnknown == riid ) reinterpret_cast<IUnknown*>(*ppvObject)->AddRef(); } |
HRESULT CBindStatusCallback::GetBindInfo( *grfBINDF = BINDF_ASYNCHRONOUS; DWORD cbSize = pbindinfo->cbSize; return S_OK; } |
///// IWindowForBindingUI
|