Xcode OISdylib:被调用的对象类型不是函数或函数指针

时间:2012-11-30 17:26:55

标签: xcode macos

我有这个错误,我无法弄清楚问题是什么。 错误是:kCGWindowBound< ---被称为对象类型'CFStringRef'(又名'const_CFString *')不是函数或函数指针 OSX 10.7.4上的Xcode 4.3.3

void MacMouse::_initialize(){   
mState.clear();     
mTempState.clear();     
mMouseWarped = false; 
// Hide OS Mouse
    CGDisplayHideCursor(kCGDirectMainDisplay);

    MacInputManager* im = static_cast<MacInputManager*>(mCreator);
    WindowRef win = im->_getWindow();

    if(win)
    {
        Rect clipRect = {0.0f, 0.0f, 0.0f, 0.0f};
        kCGWindowBounds(win, kWindowContentRgn, &clipRect);

        CGPoint warpPoint;
        warpPoint.x = ((clipRect.right - clipRect.left) / 2) + clipRect.left;
        warpPoint.y = ((clipRect.bottom - clipRect.top) / 2) + clipRect.top;
        CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, warpPoint); //Place at display origin

        mMouseWarped = true;
    }

    //Now that mouse is warped, start listening for events
    EventTargetRef event = ((MacInputManager*)mCreator)->_getEventTarget();

    if(mouseEventRef != NULL)
        RemoveEventHandler(mouseEventRef);

    if(mWindowFocusHandler != NULL)
        RemoveEventHandler(mWindowFocusHandler);

    mouseEventRef = mWindowFocusHandler = NULL;

    if(InstallEventHandler(event, mouseUPP, GetEventTypeCount(mouseEvents), mouseEvents, this, &mouseEventRef) != noErr)
        OIS_EXCEPT( E_General, "MacMouse::_initialize >> Error loading Mouse event handler" );

    if(InstallEventHandler(event, mWindowFocusListener, GetEventTypeCount(WinFocusAcquired), WinFocusAcquired, this, &mWindowFocusHandler) != noErr)
        OIS_EXCEPT( E_General, "MacMouse::_initialize >> Error loading Mouse event handler" );      

    //Lock OS Mouse movement
    mNeedsToRegainFocus = false;
    CGAssociateMouseAndMouseCursorPosition(FALSE);
}

0 个答案:

没有答案