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

C / C++ / MFC

 
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 
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 
The reason you get a warning about CreateWindowExA rather than CreateWindow is that CreateWindow is a #define for CreateWindowA (if UNICODE is not defined), and that CreateWindowA is a #define for CreateWindowExA, passing 0 for the first parameter. Documentation for this version is under CreateWindowEx.

This means that when the compiler complains about parameter 10, you need to fix parameter 9.

You do need to cast ISVM_STARTISV to HMENU. I don't know why your command stops working. Your code should then look like:
hwndStartButton = CreateWindow(
   "button",
   szLoadStringOne,
   WS_CHILDWINDOW | WS_VISIBLE | WS_EX_TOPMOST | BS_PUSHBUTTON,
   rect.right / 2 - 100,
   (rect.bottom + 380) / 2 - 50,
   200,
   25,
   hwnd,
   (HMENU)ISVM_STARTISV,
   hInst,
   NULL
);
(style guide: prefer a reinterpret_cast<hmenu> rather than a C-style cast if using C++).

I don't know why your button should stop working, though. Put a breakpoint in the parent window's WindowProc to see what value gets sent when you click the button.

The final problem is because HMENU is declared
typedef struct HMENU__ * HMENU;
if STRICT is defined. If you see an error referring to Hxxx__ in Windows code, remove the two underscores and one * to interpret it properly.
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 
AnswerRe: What fun! :-) Pin
Monty215-Jan-04 23:18
Monty215-Jan-04 23:18 

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.