// Shldocvw Versions:
// IE 3.x maj=4 min=70
// IE 4.0 maj=4 min=71
// IE 4.01 maj=4 min=72
// IE 5.0 maj=5 min=00
// IE 5.5 maj=5 min=50
// IE 6.0 maj=6 min=00
static HRESULT AtlGetShdocvwVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)
{
ATLASSERT(pdwMajor != NULL && pdwMinor != NULL);
if(::IsBadWritePtr(pdwMajor, sizeof(DWORD)) || ::IsBadWritePtr(pdwMinor, sizeof(DWORD)))
return E_INVALIDARG;
DLLVERSIONINFO dvi;
::ZeroMemory(&dvi, sizeof(dvi));
dvi.cbSize = sizeof(dvi);
HRESULT hRet = AtlGetDllVersion(_T("shdocvw.dll"), &dvi);
if(SUCCEEDED(hRet))
{
*pdwMajor = dvi.dwMajorVersion;
*pdwMinor = dvi.dwMinorVersion;
}
else if(hRet == E_NOTIMPL)
{
// If DllGetVersion is not there, then the DLL is a version
// previous to the one shipped with IE 3.x
*pdwMajor = 4;
*pdwMinor = 0;
hRet = S_OK;
}
return hRet;
}