How do I remove the warning "conversion from 'int' to 'HMENU' of greater size"?

CDev-8220 220 Reputation points
2023-11-29T19:52:25.3933333+00:00

I followed the guide on Creating, Enumerating, and Sizing Child Windows, but I'm getting a warning on this line of code:

(HMENU) (int) (ID_FIRSTCHILD + i), 

warning C4312: 'type cast': conversion from 'int' to 'HMENU' of greater size

How do I fix this?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,625 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. Barry Schwarz 2,506 Reputation points
    2023-11-29T20:21:57.5866667+00:00

    Look up the #pragma warning disable feature.

    0 comments No comments