Whats thepointer to function type on this code?

Garrett Tiller 6 Reputation points
2023-03-02T00:44:17.11+00:00

I'm setting up the code where the cursor clicks the text

bool StartScreen::isTextClicked()
{
    auto state = m_mouse->Get().GetState();

    RECT rect =
    {
        state.x, state.y, static_cast<long>(m_fontPos.x), static_cast<long>(m_fontPos.y)
    };


    if (rect(state.positionMode()))
        return true;

    //Otherwise, don't do anything
    return false;

}

this line

if (rect(state.positionMode()))
        return true;

keeps getting this error

E0109 expression preceding parentheses of apparent call must have (pointer-to-) function type

Developer technologies C++
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 13,501 Reputation points Microsoft External Staff
    2023-03-02T01:57:44.9533333+00:00

    Hi, Garrett Tiller
    RECT does not provide related funtion rect().
    Please check document RECT structure.

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.