Click here to Skip to main content
15,899,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMapping Network drives Pin
Priya..k9-Jan-06 4:07
Priya..k9-Jan-06 4:07 
AnswerRe: Mapping Network drives Pin
David Crow9-Jan-06 4:20
David Crow9-Jan-06 4:20 
QuestionWhich Callback? Pin
Maciej Lisiewski9-Jan-06 3:48
Maciej Lisiewski9-Jan-06 3:48 
AnswerRe: Which Callback? Pin
Rage9-Jan-06 6:10
professionalRage9-Jan-06 6:10 
GeneralRe: Which Callback? Pin
Maciej Lisiewski9-Jan-06 6:34
Maciej Lisiewski9-Jan-06 6:34 
GeneralRe: Which Callback? Pin
Rage9-Jan-06 8:12
professionalRage9-Jan-06 8:12 
Questionthread and standard Input (stdin) Pin
hellomoin9-Jan-06 3:33
hellomoin9-Jan-06 3:33 
QuestionError Message Tables - who to implement them Pin
Sebastian Schneider9-Jan-06 2:47
Sebastian Schneider9-Jan-06 2:47 
Hello everyone,

I am currently in the progress of enhancing a software which my predecessor designed.

One of the caveats the software has: If there is an error, the software calls a "setErrorMessage"-Function to publish the error to the user. The same is true for warning messages, only that warning messages are collected until the called function either finished or hits an error.

Thats pretty ok for me, I dont think I would have chosen another approach.

Well, what makes this a bad design is that the setters are - each and every time - called with the text for the warning message as an argument.

There are SEVERAL messages that just get repeated all over the software, most notably a "nothing to process"-message, which is set in about 52 different locations, with different spelling, different capitalization, different wording... you name it, its probably in there.

So, I want to replace this with an error lookup table, passing a single number and setting the corresponding error message.

I have, so far, thought of several approaches to do this.

Common ground: I would be overloading "setErrorMessage(const std::string& msg)" with another function "setErrorMessage(const int msgID)" in order to maintain compatibility (there are client-made libs using this functionality).

What I am having a hard time with is selecting a fast and reliable way to store the messages and their IDs.

Any help, ideas, suggestions? Everything is welcome Smile | :)

Cheers,
Sebastian

--
Contra vim mortem non est medicamen in hortem.
QuestionRe: Error Message Tables - who to implement them Pin
David Crow9-Jan-06 3:03
David Crow9-Jan-06 3:03 
AnswerRe: Error Message Tables - who to implement them Pin
Rage9-Jan-06 6:18
professionalRage9-Jan-06 6:18 
AnswerRe: Error Message Tables - who to implement them Pin
Blake Miller9-Jan-06 7:09
Blake Miller9-Jan-06 7:09 
AnswerRe: Error Message Tables - who to implement them Pin
Sebastian Schneider9-Jan-06 20:11
Sebastian Schneider9-Jan-06 20:11 
QuestionHow to read from a text file? Pin
Amarelia9-Jan-06 2:14
Amarelia9-Jan-06 2:14 
AnswerRe: How to read from a text file? Pin
Chris Losinger9-Jan-06 2:18
professionalChris Losinger9-Jan-06 2:18 
AnswerRe: How to read from a text file? Pin
toxcct9-Jan-06 2:21
toxcct9-Jan-06 2:21 
QuestionRe: How to read from a text file? Pin
David Crow9-Jan-06 3:06
David Crow9-Jan-06 3:06 
QuestionPrinter Monitoring Pin
micutzu9-Jan-06 1:44
micutzu9-Jan-06 1:44 
AnswerRe: Printer Monitoring Pin
David Crow9-Jan-06 3:09
David Crow9-Jan-06 3:09 
GeneralRe: Printer Monitoring Pin
Dudi Avramov9-Jan-06 4:07
Dudi Avramov9-Jan-06 4:07 
GeneralRe: Printer Monitoring Pin
David Crow9-Jan-06 4:18
David Crow9-Jan-06 4:18 
GeneralRe: Printer Monitoring Pin
micutzu10-Jan-06 1:55
micutzu10-Jan-06 1:55 
Questioncreate window Pin
Anu_Bala9-Jan-06 1:04
Anu_Bala9-Jan-06 1:04 
AnswerRe: create window Pin
toxcct9-Jan-06 2:06
toxcct9-Jan-06 2:06 
Question\0 esc-characters in 4-byte-characters Pin
bytefactory9-Jan-06 0:54
bytefactory9-Jan-06 0:54 
AnswerRe: \0 esc-characters in 4-byte-characters Pin
Chris Losinger9-Jan-06 1:34
professionalChris Losinger9-Jan-06 1:34 

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.