|
-
May 22nd, 2012, 02:02 PM
#1
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.
-
May 22nd, 2012, 04:32 PM
#2
Re: DELETE_EXCEPTION(e) undefined
 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
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
-
May 23rd, 2012, 08:39 AM
#3
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
-
May 23rd, 2012, 11:13 AM
#4
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.
Last edited by VictorN; May 23rd, 2012 at 11:15 AM.
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|