Click here to Skip to main content
15,920,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow do I Create a class with class wizard that derives from CObject? Pin
Ian Bowler9-Sep-04 19:46
Ian Bowler9-Sep-04 19:46 
AnswerRe: How do I Create a class with class wizard that derives from CObject? Pin
Arsalan Malik9-Sep-04 20:55
Arsalan Malik9-Sep-04 20:55 
GeneralRe: How do I Create a class with class wizard that derives from CObject? Pin
Ian Bowler10-Sep-04 6:46
Ian Bowler10-Sep-04 6:46 
Generalcom port settings using MFC Dialog Based Pin
anuchelvi9-Sep-04 18:57
anuchelvi9-Sep-04 18:57 
GeneralC Plus Plus Code Help Forums Pin
Texasgulfcoast9-Sep-04 18:01
sussTexasgulfcoast9-Sep-04 18:01 
GeneralRe: C Plus Plus Code Help Forums Pin
Cedric Moonen9-Sep-04 20:29
Cedric Moonen9-Sep-04 20:29 
Generalschool program =( Pin
ISUstudent9-Sep-04 17:21
ISUstudent9-Sep-04 17:21 
GeneralRe: school program =( Pin
Christian Graus9-Sep-04 17:37
protectorChristian Graus9-Sep-04 17:37 
Hi there.

First of all, no real world code would ever work like this. You would never have a fixed length array, for starters. If you must have a fixed length array, your paramaterless constructor should be private, otherwise you can build a menu that does nothing. Of what value is a menu with 0 choices ?

The int numChoices is not defined in this class. I assume it is private, so that it cannot be changed except by the constructor.

I don't see anywhere that you're actually accepting input from the user ?

Once you have a char, you can use atoi to turn it into an integer. You should initialise choice to -1 in validateChoice. I believe there is a function called IsAlpha, and one called IsAlphaNum in the C libraries, so if the character entered IsAlphaNum, and NOT IsAlpha, it must be a number.

You also have not defined the default values for the strings for menu choices 3-8.

ISUstudent wrote:
See Technical Help for Program 2 for validation techniques

Given that this is your core question, I must ask if you bothered to read this first ?

Christian

I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
GeneralRe: school program =( Pin
ISUstudent9-Sep-04 18:06
ISUstudent9-Sep-04 18:06 
GeneralRe: school program =( Pin
David Crow10-Sep-04 3:05
David Crow10-Sep-04 3:05 
GeneralRe: school program =( Pin
Anonymous10-Sep-04 22:24
Anonymous10-Sep-04 22:24 
GeneralRe: school program =( Pin
9-Sep-04 22:07
suss9-Sep-04 22:07 
GeneralRe: school program =( Pin
rotu9-Sep-04 22:26
rotu9-Sep-04 22:26 
GeneralRe: school program =( Pin
Mike Beckerleg9-Sep-04 23:50
Mike Beckerleg9-Sep-04 23:50 
GeneralRe: school program =( Pin
ISUstudent10-Sep-04 5:06
ISUstudent10-Sep-04 5:06 
GeneralMFC app doesn't work in debug mode, works in release mode Pin
Indrawati9-Sep-04 17:03
Indrawati9-Sep-04 17:03 
GeneralRe: MFC app doesn't work in debug mode, works in release mode Pin
Christian Graus9-Sep-04 17:38
protectorChristian Graus9-Sep-04 17:38 
GeneralReading a file using serialization Pin
hemanth_phk9-Sep-04 12:17
susshemanth_phk9-Sep-04 12:17 
GeneralRe: Reading a file using serialization Pin
David Crow10-Sep-04 3:15
David Crow10-Sep-04 3:15 
GeneralCan't open listening socket on Win2k3 Server Pin
Jon Betzold9-Sep-04 11:52
Jon Betzold9-Sep-04 11:52 
GeneralFigured it out Pin
Jon Betzold9-Sep-04 12:57
Jon Betzold9-Sep-04 12:57 
GeneralError - windows.h already included Pin
skg7479-Sep-04 11:49
skg7479-Sep-04 11:49 
GeneralRe: Error - windows.h already included Pin
Arsalan Malik9-Sep-04 19:32
Arsalan Malik9-Sep-04 19:32 
GeneralRe: Error - windows.h already included Pin
David Crow10-Sep-04 3:17
David Crow10-Sep-04 3:17 
GeneralRe: Error - windows.h already included Pin
skg74710-Sep-04 6:07
skg74710-Sep-04 6:07 

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.