Can't compile code with menu_selector in Visual Studio 2012 / Win32

Trying this simple code:

    CCMenuItemSprite *playButton = CCMenuItemSprite::create(
                                                            CCSprite::createWithSpriteFrameName("Play01.png"),
                                                            CCSprite::createWithSpriteFrameName("Play02.png"),
                                                            this,
                                                            menu_selector(TitleLayer::optionPlay));

    CCMenu *menu = CCMenu::create(playButton, NULL);

    // Add menu to layer
    this->addChild(menu, 2);

In Visual Studio 2010 I have no problems… but in Visual Studio 2012 I got this:

  TitleScene.cpp
c:\my\path\to\code\titlescene.cpp(86): error C2440: 'conversión de tipo' : no se puede realizar la conversión de 'void (__thiscall TitleLayer::* )(void)' a 'cocos2d::SEL_MenuHandler'
          Los punteros a miembros tienen distintas representaciones; no se puede realizar la conversión entre ellos

Why?!

I think is related with this article: http://stackoverflow.com/questions/15472857/critique-about-cocos2d-x-coding-style-c-style-casts-vs-static-cast

Hi,
TitleLayer::optionPlay should be void TitleLayer::optionPlay(CCObject* pObject)

It works!

I was really stuck by this problem.

Thanks :slight_smile: