Doomulation
?????????????????????????
Okay I was wondering if you could help me dicipline my compiler a little... it all works well in debug, but in release - once again - it sees the code "unneccesary" and thus removes it. The problem is that it removes my error catching code! Look below...
It removes the entire catch statement. And the functions up ahead DOES throw exceptions if something goes wrong. Is there anything that can be done to prevent this? Save for disabling optimizations for that function of course... that's the last solution I wish to use.
Hmmm... actually, this is the SECOND time I encounter this problem. It happend another time in a function that threw exceptions.
Any ideas?
Code:
SettingsType type = { 1, this, strKey };
try
{
EnumChildWindows(pDlg->m_hWnd,EnumChildReg,(LPARAM)&type);
}
catch(HRESULT hr)
{
CString strError = LoadStringRes(IDS_ERROR_REGISTRY_GET);
if (hr == ERROR_ACCESS_DENIED)
strError += LoadStringRes(IDS_ERROR_ACCESSDENIED);
else
strError += ErrorToString(hr);
ErrBox(strError);
}
It removes the entire catch statement. And the functions up ahead DOES throw exceptions if something goes wrong. Is there anything that can be done to prevent this? Save for disabling optimizations for that function of course... that's the last solution I wish to use.
Hmmm... actually, this is the SECOND time I encounter this problem. It happend another time in a function that threw exceptions.
Any ideas?