DELETE_EXCEPTION(e) undefined
I amusing DELETE_EXCEPTION(e) in my code but it gives compiler error:
Code:
error C3861: 'DELETE_EXCEPTION': identifier not found
It is originally used in MFC in CArhive::ReadString() function
Code:
........
CATCH(CArchiveException, e)
{
if (e && e->m_cause == CArchiveException::endOfFile)
{
DELETE_EXCEPTION(e);
if (nRead == 0)
return NULL;
}
else
{
THROW_LAST();
}
}
END_CATCH
I need to clone this function in my application but DELETE_EXCEPTION gives error. I don't know where is it defined and since CArchive::ReadString() already builds, not sure why I am getting this error in the first place? Thanks.
Re: DELETE_EXCEPTION(e) undefined
Quote:
Originally Posted by
zspirit
I need to clone this function in my application but DELETE_EXCEPTION gives error. I don't know where is it defined
Quote:
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\stdafx.h
That is where it's located on my machine.
Regards,
Paul McKenzie
Re: DELETE_EXCEPTION(e) undefined
This is a little strange that there are going to be to files with same name "stdafx.h" included, the other being in the project folder. I wonder what would have happen if I add the include path for 'c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\stdafx.h'. How is the compiler going to decided which file do we want to add when it has both include paths? Maybe it will find the file in one folder and stop looking at the other!?
On the other hand adding absolute path like that is not going to be great because the path may differ on difference PC. In my PC it is in Microsoft Visual Studio 10.0 folder
Re: DELETE_EXCEPTION(e) undefined
You should not add this include path.
Instead #define this macro locally (if it is not #defined) or just replace it withAlso have a look at this thread.