Locien
03-05-2013 01:27:24
This is the code in question:
Gives me the error: main.cpp(499): error C2660: 'MyGUI::newDelegate' : function does not take 2 arguments
For some reason my compiler(MSVC2010) says that newDelegate doesn't take two arguments, I'm absolutely at a loss as to what to do. After some googling I found this page which states that there's a bug in Visual Studio so you have to use a different approach. So I tried to change it to
mChatWindow->eventKeyButtonPressed += MyGUI::newDelegate(static_cast<Main *>(this), &Main::keyPressed);
But I get the exact same error. What am I supposed to do to get it to work? Does anyone know a fix for this problem? I'm using the latest stable version.
Thanks in advance.
Edit: Another problem. Why doesn't mChatWindow->setCaption("Hello world!"); display any text? The way I understood it is that setCaption is used to display text, am I doing something wrong?
mChatWindow = mGUI->createWidget<MyGUI::Window>("WindowCSX", 2, mWindow->getHeight()-300, 500, 300, MyGUI::Align::Default, "Overlapped");
mChatWindow->eventKeyButtonPressed += MyGUI::newDelegate(this, &Main::keyPressed);
Gives me the error: main.cpp(499): error C2660: 'MyGUI::newDelegate' : function does not take 2 arguments
For some reason my compiler(MSVC2010) says that newDelegate doesn't take two arguments, I'm absolutely at a loss as to what to do. After some googling I found this page which states that there's a bug in Visual Studio so you have to use a different approach. So I tried to change it to
mChatWindow->eventKeyButtonPressed += MyGUI::newDelegate(static_cast<Main *>(this), &Main::keyPressed);
But I get the exact same error. What am I supposed to do to get it to work? Does anyone know a fix for this problem? I'm using the latest stable version.
Thanks in advance.
Edit: Another problem. Why doesn't mChatWindow->setCaption("Hello world!"); display any text? The way I understood it is that setCaption is used to display text, am I doing something wrong?