Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDesktop and DirectX Pin
AlexMart16-Jan-04 3:38
AlexMart16-Jan-04 3:38 
GeneralRe: Desktop and DirectX Pin
Andrew Walker16-Jan-04 19:26
Andrew Walker16-Jan-04 19:26 
Questionusing c++ in a VS.NET setup project?? Pin
schaereran@gmx.net16-Jan-04 1:59
schaereran@gmx.net16-Jan-04 1:59 
AnswerRe: using c++ in a VS.NET setup project?? Pin
Robert M Greene16-Jan-04 8:43
Robert M Greene16-Jan-04 8:43 
GeneralRe: using c++ in a VS.NET setup project?? Pin
Robert M Greene16-Jan-04 8:45
Robert M Greene16-Jan-04 8:45 
GeneralRe: using c++ in a VS.NET setup project?? Pin
schaereran@gmx.net18-Jan-04 22:21
schaereran@gmx.net18-Jan-04 22:21 
Generalwarning C4047: 'function' : 'struct HMENU__ *' differs in levels of indirection from 'const int ' Pin
AssemblySoft16-Jan-04 1:20
AssemblySoft16-Jan-04 1:20 
GeneralRe: warning C4047: 'function' : 'struct HMENU__ *' differs in levels of indirection from 'const int ' Pin
Antti Keskinen16-Jan-04 3:48
Antti Keskinen16-Jan-04 3:48 
What the MSDN fragment states is correct: this parameter specifies a handle to a menu, or a child-window identifier if WS_CHILD flag is set.

Check your window style definition: you are giving it WS_CHILDWINDOW instead of WS_CHILD. I think the code is a bit picky on this one, eventhough WS_CHILDWINDOW were defined similarly as WS_CHILD. Use WS_CHILD instead.

To eliminate the warning, you can either one of the following calling conventions. The first one does a static conversion, and the latter a static cast:
hwndStartButton = CreateWindow( "button", szLoadStringOne, WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, ... , hWnd, (HMENU) ISVM_STARTISV, hInst, NULL);<DIV>

hwndStartButton = CreateWindow( "button", szLoadStringOne, WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, ... , hWnd, static_cast<HMENU>( ISVM_STARTISV ), hInst, NULL);
I am not completely sure how the first call will behave, but the second one should not give any warnings related to this matter. I might've typoed in there, so be careful when copying it. Also, you tried in your last lines to convert it to HMENU*. But that is not what the function requires. It wants a handle to a loaded menu, not a pointer to it's location. Just pass the ISVM_STARTISV, converting it to type HMENU with either one of the routines stated above.

As you can also see, I have removed the WS_EX_TOPMOST style from the call, as you can only use extended style flags when you use the CreateWindowEx function.

The topmost style is not appliable to a button: it will always be drawn "before" (in front of) it's parent window in Z-order. Otherwise your button would always be shown, even if there was a dialog "between" the parent window and the button. That would look extremely ackward, don't you think ?

I hope this will be help to you. If it doesn't work, post results here for more analysis..

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: warning C4047: 'function' : 'struct HMENU__ *' differs in levels of indirection from 'const int ' Pin
Mike Dimmick16-Jan-04 4:03
Mike Dimmick16-Jan-04 4:03 
GeneralRe: warning C4047: 'function' : 'struct HMENU__ *' differs in levels of indirection from 'const int ' Pin
AssemblySoft19-Jan-04 0:04
AssemblySoft19-Jan-04 0:04 
GeneralUsing Parallel Port Pin
Best Friend16-Jan-04 1:18
Best Friend16-Jan-04 1:18 
GeneralRe: Using Parallel Port Pin
Antti Keskinen16-Jan-04 3:58
Antti Keskinen16-Jan-04 3:58 
GeneralRe: Using Parallel Port Pin
valikac16-Jan-04 5:16
valikac16-Jan-04 5:16 
Generalgets the Windows operating system code page Pin
padmakumara16-Jan-04 1:04
padmakumara16-Jan-04 1:04 
GeneralRe: gets the Windows operating system code page Pin
User 665816-Jan-04 1:16
User 665816-Jan-04 1:16 
GeneralRe: gets the Windows operating system code page Pin
David Crow16-Jan-04 3:36
David Crow16-Jan-04 3:36 
GeneralRe: gets the Windows operating system code page Pin
padmakumara18-Jan-04 22:49
padmakumara18-Jan-04 22:49 
GeneralRe: gets the Windows operating system code page Pin
David Crow19-Jan-04 2:15
David Crow19-Jan-04 2:15 
GeneralRe: gets the Windows operating system code page Pin
Robert M Greene19-Jan-04 5:15
Robert M Greene19-Jan-04 5:15 
GeneralFind files recursively in subdirectories Pin
mjvalan16-Jan-04 0:59
mjvalan16-Jan-04 0:59 
GeneralRe: Find files recursively in subdirectories Pin
Johnny ²16-Jan-04 1:42
Johnny ²16-Jan-04 1:42 
Generalrecycle bin info2 path ??plz help Pin
rohit.dhamija15-Jan-04 23:11
rohit.dhamija15-Jan-04 23:11 
GeneralRe: recycle bin info2 path ??plz help Pin
David Crow16-Jan-04 3:40
David Crow16-Jan-04 3:40 
QuestionWhen is my window hidden? Pin
Rhodri Jenkins15-Jan-04 23:07
Rhodri Jenkins15-Jan-04 23:07 
QuestionWhat fun! :-) Pin
Roger Wright15-Jan-04 22:48
professionalRoger Wright15-Jan-04 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.