Hi,@Flaviu_
Try the snippet:
try {
CInternetSession session;
auto pFile = session.OpenURL(_T("htt://www.example.com"));//custom link error
}
catch (CInternetException* pEx) {
TCHAR szError[1024];
pEx->GetErrorMessage(szError, 1024);
std::string errorMessage;
#ifdef _UNICODE
errorMessage = CW2A(szError);
#else
errorMessage= szError;
#endif
OutputDebugStringA(("error: "+ errorMessage).c_str());
pEx->Delete();
}
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.