N
Neil.Fang.CN
I have a Win32 static lib, have a class member function like this:
typedef boost::function<void (int)> TimerCallbackType;
class TimerManager
{
public:
int addTimer(int interval, TimerCallbackType callback);
};
I use this lib in a Win32 exe, but it crashed, the error is:
"Run-time check failure #0 - The value of ESP was not properly saved
across a function call ... ".
It seems that the destructor of boost::function break the stack.. But
boost::function object work fine in the exe project, only crashed in
this occasion - call the "addTimer()" of the lib.
In this situation(call "addTimer" of lib), how the boost::function
template be instantiated? Does the copy constructor instantiated in
the exe project, the destructor instantiated in the lib project? So,
maybe the setting of the two projects is different, make the
constructor/destructor mismatched?
I'm using MS Visual C++ 8.0
$B!]!](BNeil
typedef boost::function<void (int)> TimerCallbackType;
class TimerManager
{
public:
int addTimer(int interval, TimerCallbackType callback);
};
I use this lib in a Win32 exe, but it crashed, the error is:
"Run-time check failure #0 - The value of ESP was not properly saved
across a function call ... ".
It seems that the destructor of boost::function break the stack.. But
boost::function object work fine in the exe project, only crashed in
this occasion - call the "addTimer()" of the lib.
In this situation(call "addTimer" of lib), how the boost::function
template be instantiated? Does the copy constructor instantiated in
the exe project, the destructor instantiated in the lib project? So,
maybe the setting of the two projects is different, make the
constructor/destructor mismatched?
I'm using MS Visual C++ 8.0
$B!]!](BNeil