If one program works the library and another one doesn't, then the
two programs are probably compiled with different options
(stdcall versus cdecl) or are using different prototypes (so that
one of them is pushing the wrong number of arguments on the
Be very glad for that error message. Without that check this
type of error is about one hundred times harder to track down.
> Hi all
> After replacing a C++ class by a new one my program crashes with the
> Microsoft Visual C++ Debug Library
> Debug Error!
> Program: ...
> File: i386\chkesp.c
> Line: 42
> The value of ESP was not properly saved across a function call.
> This is usually the result of calling a function declared with one
> calling convention with a function pointer declared with a different
> calling convention.
> Looking for messages in the newsgroups I found that there are very
> different situations causing this error but no explanation is given. A
> curious thing is that another program using the same libraries as the
> crashing one runs without any problems.
> Has any one an idea what is going wrong ???
.Bruce Dawson, Humongous Entertainment.