Sign in to follow this  

Using int, as hmenu number, but getting warnings..what to do?

Recommended Posts

Hi, in my program I am using: int menuNo = 0; to store the HMENU id. eg: HMENU hmenu = (HMENNU)menuNo; But I am getting converting to larger size or something like that, so I was wondering what I can do to top these warning messages, without using #disable pragma type stuff, also I remember there was some function that would convert numbers into HMENU format, but I can't remember what that was, any idea? Thanks btw: When I do: HMENU hmenu = (HMENNU)0; I get no warnings, but the way my program works, I cant do that.

Share this post

Link to post
Share on other sites
why not store the menu number as a HMENU?(btw, it's #pragma disable(warning:warningNum), IIRC). I know nothing about Win32 API, or whatever your using so I'm not sure if that would work for your program(could HMENU be a pointer? If so, you'd need to pass it more than just a normal menu number, it'd need to be a memory location)

Share this post

Link to post
Share on other sites
there should not be any warnings. Can you paste some of them here.

This is how child buttons should be created :

for (i = 0 ; i < NUM ; i++)
hwndButton[i] = CreateWindow ( TEXT("button"),
WS_CHILD | WS_VISIBLE | button[i].istyle,
cxChar, cyChar * (1 + 2 * i),
20 * cxChar, 7 * cyChar / 4,
hwnd, (HMENU) i,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
return 0 ;

where int i ;

Actually as i got it right the HMENU is the number that helps you find out with what object are you working on

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this