Reinterpret cast generates fatal stack overflow error?
Posted on 2007-03-17
I am using MFC and managed code in the same file.
When using a reinterpret_cast to cast an internet connection pointer, I get a fatal stack overflow error. The problem is intermittent in that it might fail twice, and then on the next 2 tries it will work. The code is:
CInternetFile* pFile = NULL;
// We know for sure that this is an Internet File so the cast is safe
cout << "Inside TRY BLOCK" << endl;
pFile = NULL;
pFile = reinterpret_cast<CInternetFile*>(mysession.OpenURL(pszURL));
cout << "pFile in TRY is : " << pFile << endl;
The output statements are for runtime diagnostics.