Click here to Skip to main content
15,894,291 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How do startup programs work. Pin
Antti Keskinen15-Nov-03 14:20
Antti Keskinen15-Nov-03 14:20 
GeneralRe: How do startup programs work. Pin
Snyp15-Nov-03 14:23
Snyp15-Nov-03 14:23 
GeneralRe: How do startup programs work. Pin
Antti Keskinen15-Nov-03 14:39
Antti Keskinen15-Nov-03 14:39 
QuestionGet the first sector of harkdisk in vc++ ? Pin
kendao15-Nov-03 13:38
kendao15-Nov-03 13:38 
AnswerRe: Get the first sector of harkdisk in vc++ ? Pin
Michael Gunlock16-Nov-03 5:54
Michael Gunlock16-Nov-03 5:54 
Questioncreate 100 button in dialog with code ? Pin
kendao15-Nov-03 13:34
kendao15-Nov-03 13:34 
AnswerRe: create 100 button in dialog with code ? Pin
Snyp15-Nov-03 14:23
Snyp15-Nov-03 14:23 
AnswerRe: create 100 button in dialog with code ? Pin
Antti Keskinen15-Nov-03 14:34
Antti Keskinen15-Nov-03 14:34 
Creating code-wise buttons requires several steps:

1. Add CButton (or derived) member variables to the dialog class's header file. You can use an array here if you want.
2. For each member variable/array member, call it's Create member method. See MSDN and CButton for parameters of this function.
3. When all buttons are created, you need to show them by using ShowWindow method.
4. Either add a message-map entry to your application for every button ID (ON_BN_CLICKED) or overwrite the window procedure of the application. Now display a message box using AfxMessageBox global method. If you want to map all control IDs to a single handler, you need to use a ON_CONTROL_RANGE message map entry. See MSDN for more details.

To customize the message of the message box, create a CString object and call it's 'Format' to do printf-style formatting for the string. You need to get the ID from the message. Buttons, when clicked, send BN_CLICKED message to the parent. In this message, the control ID is in the low-order word of wParam. See MSDN for more details.

I hope this'll help you get started Smile | :)

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralC++ Question. Pin
WREY15-Nov-03 12:39
WREY15-Nov-03 12:39 
GeneralRe: C++ Question. Pin
Antti Keskinen15-Nov-03 14:50
Antti Keskinen15-Nov-03 14:50 
GeneralRe: C++ Question. Pin
WREY15-Nov-03 16:22
WREY15-Nov-03 16:22 
GeneralRe: C++ Question. Pin
Michael Dunn15-Nov-03 16:37
sitebuilderMichael Dunn15-Nov-03 16:37 
GeneralRe: C++ Question. Pin
WREY15-Nov-03 17:49
WREY15-Nov-03 17:49 
GeneralRe: C++ Question. Pin
Peter Weyzen15-Nov-03 18:26
Peter Weyzen15-Nov-03 18:26 
GeneralRe: C++ Question. Pin
Christian Graus16-Nov-03 16:22
protectorChristian Graus16-Nov-03 16:22 
GeneralHelp with searching for things in text files. Pin
Snyp15-Nov-03 12:00
Snyp15-Nov-03 12:00 
GeneralRe: Help with searching for things in text files. Pin
Peter Molnar15-Nov-03 14:42
Peter Molnar15-Nov-03 14:42 
GeneralRe: Help with searching for things in text files. Pin
Snyp15-Nov-03 14:44
Snyp15-Nov-03 14:44 
GeneralRe: Help with searching for things in text files. Pin
Antti Keskinen15-Nov-03 14:56
Antti Keskinen15-Nov-03 14:56 
GeneralRe: Help with searching for things in text files. Pin
Snyp15-Nov-03 14:59
Snyp15-Nov-03 14:59 
GeneralRe: Help with searching for things in text files. Pin
Peter Molnar15-Nov-03 14:57
Peter Molnar15-Nov-03 14:57 
GeneralRe: Help with searching for things in text files. Pin
Joe Woodbury15-Nov-03 18:57
professionalJoe Woodbury15-Nov-03 18:57 
GeneralRe: Help with searching for things in text files. Pin
Joe Woodbury15-Nov-03 18:50
professionalJoe Woodbury15-Nov-03 18:50 
General_CrtIsValidHeapPointer Pin
DougW4815-Nov-03 11:26
DougW4815-Nov-03 11:26 
GeneralWindows Explorer Pin
harsh91115-Nov-03 9:54
harsh91115-Nov-03 9:54 

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.