BYTE lpBuffer[2048]; DWORD lpdwBufferLength = sizeof(lpBuffer); //CInternetSession session created before and valid and working //attempt 1 BOOL resQueryOption = session.QueryOption((DWORD)INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT, lpBuffer,&lpdwBufferLength); DWORD erro1r = GetLastError(); //ERROR_INTERNET_INCORRECT_HANDLE_TYPE //attempt 2 HINTERNET hInternet = (HINTERNET )session; //provides handle OK BOOL resInternetQueryOption = InternetQueryOption( hInternet, INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT, lpBuffer, &lpdwBufferLength); DWORD error2 = GetLastError(); //ERROR_INTERNET_INCORRECT_HANDLE_TYPE
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)