Problem with MyGUI + boost?

Jad

25-06-2011 18:55:09

I have this line:

boost::function<void(Dialog*, const std::string&)> my_function = boost::bind(&GUIManager::openSaveDialogCallback, *this, _1, _2);

It works fine if i add it before initializing MyGUI. However if i add it after this:

mPlatform = new MyGUI::OgrePlatform();

I get:
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Assertion failed!

Program: ...
File: d:\program files (x86)\mygui_3.2...\mygui_...tform.h
Line: 57

Expression: mIsInitialise

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)
---------------------------
Abort Retry Ignore
---------------------------


What gives?

Jad

27-06-2011 15:35:51

Nevermind, my noobiness strikes again.

Changed to this:
boost::function<void(Dialog*, const std::string&)> my_function = boost::bind(&GUIManager::openSaveDialogCallback, this, _1, _2);

and it worked. I was passing *this instead of this.