Using int, as hmenu number, but getting warnings..what to do?
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.
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)
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 = CreateWindow ( TEXT("button"),
button.szText,
WS_CHILD | WS_VISIBLE | button.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
This is how child buttons should be created :
for (i = 0 ; i < NUM ; i++)
hwndButton = CreateWindow ( TEXT("button"),
button.szText,
WS_CHILD | WS_VISIBLE | button.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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement