GetCursorPos + GetWindowRect vergleichen..



  • Hi ich versuche gerade in meinem prog die mausposition mittels GetCursorPos abzufragen und dann mit den Koordinaten des Fensters zu vergleichen nur leider gibt es da ein paar probleme, die mir mein compiler meldet..aber warum? alle Variablen (also einer POINT und einer RECT struktur) sind doch longs..hier mal der code:

    GetWindowRect(hwnd,&fensterKoord);
    GetCursorPos(&mausPos); 
    if(mausPos.x>=fensterKoord.left && mausPos.x<=fensterKoord.right && mausPos>=fensterKoord.top && mausPos<=fensterKoord.top+40)...
    

    und hier die fehler:

    error C2784: 'bool __cdecl std::operator >=(const class std::basic_string<_E,_Tr,_A> &,const _E *)' : could not deduce template argument for 'const class std::basic_string<_E,_Tr,_A> &' from 'struct tagPOINT'
     error C2784: 'bool __cdecl std::operator >=(const _E *,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const  *' from 'struct tagPOINT'
     error C2784: 'bool __cdecl std::operator >=(const class std::basic_string<_E,_Tr,_A> &,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const class std::basic_string<_E,_Tr,_A> &'
     from 'struct tagPOINT'
    
     error C2784: 'bool __cdecl std::operator >=(const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &,const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &)' : could not deduce template argument for 'const class std::
    reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &' from 'struct tagPOINT'
    
    error C2784: 'bool __cdecl std::operator >=(const struct std::pair<_T1,_T2> &,const struct std::pair<_T1,_T2> &)' : could not deduce template argument for 'const struct std::pair<_T1,_T2> &' from 'struct tagPOINT'
     error C2676: binary '>=' : 'struct tagPOINT' does not define this operator or a conversion to a type acceptable to the predefined operator
     error C2784: 'bool __cdecl std::operator <=(const class std::basic_string<_E,_Tr,_A> &,const _E *)' : could not deduce template argument for 'const class std::basic_string<_E,_Tr,_A> &' from 'struct tagPOINT'
     error C2784: 'bool __cdecl std::operator <=(const _E *,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const  *' from 'struct tagPOINT'
     error C2784: 'bool __cdecl std::operator <=(const class std::basic_string<_E,_Tr,_A> &,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const class std::basic_string<_E,_Tr,_A> &'
     from 'struct tagPOINT'
    
     error C2784: 'bool __cdecl std::operator <=(const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &,const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &)' : could not deduce template argument for 'const class std::
    reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &' from 'struct tagPOINT'
    
     error C2784: 'bool __cdecl std::operator <=(const struct std::pair<_T1,_T2> &,const struct std::pair<_T1,_T2> &)' : could not deduce template argument for 'const struct std::pair<_T1,_T2> &' from 'struct tagPOINT'
     error C2676: binary '<=' : 'struct tagPOINT' does not define this operator or a conversion to a type acceptable to the predefined operator
    Error executing cl.exe.
    

    weiss einer warum das nicht funzt?

    cya



  • mausPos>=fensterKoord.top

    Naja, da hast du wohl das ".y" vergessen. 😉



  • Ach du SCH*****! tja ist schon spät.. thx


Anmelden zum Antworten