Click here to Skip to main content
15,922,166 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to list member? Pin
alex.barylski16-Jan-04 10:39
alex.barylski16-Jan-04 10:39 
AnswerRe: How to list member? Pin
Gary R. Wheeler18-Jan-04 2:15
Gary R. Wheeler18-Jan-04 2:15 
Generalmessage box Pin
parthmankad16-Jan-04 7:04
parthmankad16-Jan-04 7:04 
GeneralRe: message box Pin
Maximilien16-Jan-04 7:44
Maximilien16-Jan-04 7:44 
Generalserial port communication Pin
parthmankad16-Jan-04 7:02
parthmankad16-Jan-04 7:02 
Generaldispalying record from database Pin
parthmankad16-Jan-04 7:00
parthmankad16-Jan-04 7:00 
GeneralRe: dispalying record from database Pin
Antti Keskinen16-Jan-04 8:15
Antti Keskinen16-Jan-04 8:15 
GeneralRe: dispalying record from database Pin
Antti Keskinen17-Jan-04 23:22
Antti Keskinen17-Jan-04 23:22 
GeneralMFC UI Toolkit Pin
Robert M Greene16-Jan-04 5:55
Robert M Greene16-Jan-04 5:55 
GeneralRe: MFC UI Toolkit Pin
Antti Keskinen16-Jan-04 8:35
Antti Keskinen16-Jan-04 8:35 
GeneralRe: MFC UI Toolkit Pin
alex.barylski16-Jan-04 10:02
alex.barylski16-Jan-04 10:02 
GeneralRe: MFC UI Toolkit Pin
Jörgen Sigvardsson16-Jan-04 10:25
Jörgen Sigvardsson16-Jan-04 10:25 
GeneralRe: MFC UI Toolkit Pin
alex.barylski16-Jan-04 10:53
alex.barylski16-Jan-04 10:53 
QuestionHow can i create my own font set? Pin
Jahangir Raza Shah16-Jan-04 5:35
Jahangir Raza Shah16-Jan-04 5:35 
AnswerRe: How can i create my own font set? Pin
Antti Keskinen16-Jan-04 8:37
Antti Keskinen16-Jan-04 8:37 
GeneralActive x Display Pin
Adi Narayana16-Jan-04 5:23
Adi Narayana16-Jan-04 5:23 
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 
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.

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.