470,833 Members | 1,224 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Template class object across library interface function

I have a Win32 static lib, have a class member function like this:

typedef boost::function<void (int)TimerCallbackType;
class TimerManager
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

Jun 27 '08 #1
0 1038

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Dave Rahardja | last post: by
31 posts views Thread by nikola | last post: by
7 posts views Thread by mathieu | last post: by
272 posts views Thread by Peter Olcott | last post: by
6 posts views Thread by Gaijinco | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.