LabRat,
you have a potential memory corruption problem, and without
knowing much about your application its just about impossible
to help you.
Has this code ever worked - ie, was it working in a static library before ?
hint - you might have problems if something is allocated by the code in the
dll
and deleted by the executable code.
If you are using MFC ( which I guess you are ), there is a CheckHeap()
function
which you can insert at strategic points in your program:
ASSERT( CheckHeap() );
to try to narrow down the problem. You could also use Purify if you have
a license,
although I'd explore the previous function first since it works very fast
and you might get
to the point quicker.
You should be able to trace down the problem by using the VC++ debugger, run
to
the place where the error happens and then look at the stack of calls to see
whats
happening. I suspect you are deleting memory twice, deleting something
which is
not a pointer, deleting something allocated with malloc/calloc, overwriting
a block
of memory and corrupting the heap bookkeeping structures.
dave
"LabRat" <er******@lynx.neu.edu> wrote in message
news:4d**************************@posting.google.c om...
I've been working lately to build a dynamic library (in this case, a
win32 dll) and I have encountered huge problems with it. This is my
first real attempt at doing anything like this, so it's been a
learning experience for me. I have gotten the dll to build
completely, but now I'm having a hard time getting the application
using it to run. When I run the executable I've made it generates
runtime errors:
Debug Assertion Failed!
Expression: _CrtIsValidHeapPointer (pUserData)
Is this a common problem? Or do I have a lot more debugging to do?