Foo Bar
Foo Bar

Reputation: 55

conversion from 'float' to 'LONG' requires a narrowing conversion

I'm working on a old project that I decided to pick up, when I left it I don't remember having any issues. How ever, now it seems like I have. I do get the following error: I am not sure how to fix that as I am still rather new to c++

conversion from 'float' to 'LONG' requires a narrowing conversion

> this->TextPosition = RECT{ Position.left + 3, Position.top + Height/2
> + CMyWindow::FontHeight/2 + 3, Position.right, Position.bottom };

Upvotes: 1

Views: 1203

Answers (1)

nikniknik2016
nikniknik2016

Reputation: 358

You may using cast to mute this warning:

... RECT{ static_cast<LONG>(Position.left + 3), ... and next fileds too

Upvotes: 3

Related Questions