Click here to Skip to main content
15,941,973 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C code challenge... Pin
CPallini19-Feb-23 20:47
mveCPallini19-Feb-23 20:47 
QuestionMessage Closed Pin
14-Feb-23 10:04
Member 1496877114-Feb-23 10:04 
QuestionRe: How to add #include to makefile ? Pin
Mircea Neacsu14-Feb-23 10:44
Mircea Neacsu14-Feb-23 10:44 
AnswerRe: How to add #include to makefile ? Pin
Richard MacCutchan14-Feb-23 22:03
mveRichard MacCutchan14-Feb-23 22:03 
GeneralRe: How to add #include to makefile ? Pin
k505415-Feb-23 5:39
mvek505415-Feb-23 5:39 
QuestionMessage Closed Pin
14-Feb-23 4:39
Member 1496877114-Feb-23 4:39 
AnswerRe: How to manage application configuration ? Pin
Mircea Neacsu14-Feb-23 7:57
Mircea Neacsu14-Feb-23 7:57 
AnswerRe: How to manage application configuration ? Pin
jschell15-Feb-23 6:11
jschell15-Feb-23 6:11 
Presuming that I understand what you are saying.


Member 14968771 wrote:
Some objects require knowledge / access of / to previously configured objects


That is basically an incorrect way to think of that unless you stated it incorrectly.

You have class A1 which can have an instance a1. Now a1 not A1 is the only thing that is 'configured'.

Then there is class B1 which has instance b1. And instance b1 needs access to a1. Note that b1 does NOT have access to the configuration for a1. It should not even know that a1 is 'configured'.

Conversely if b1 needs access to the same configuration information as a1 then the configuration information should not be limited to a1 but should be generic.

As an example if you have UI objects that represent a Box and a Button and both use a 'configured' color X then you would call that X something like 'outline.color.border'. You would not call it 'Box.color.border'


Now AFTER you figure out the hierarchy of the configuration data then you figure out the best way to manage it.

Generally you would have a parallel set of configuration objects which in some way are related to each other and which expose the loaded configuration data.

C#, as one example, has a dynamic class structure which supports creating from configuration files. But the same thing can be achieved (and perhaps is easier to understand) just by have one class with a method that takes a name and returns a value.

But regardless the configuration object (or objects) is entirely independent from the classes that use the configuration.

As a reminder do not forget about error handling and default values. If the configuration file is not found or a configuration value is missing (because it is misspelled) then what do you want the application (and objects) to do.
GeneralMessage Closed Pin
16-Feb-23 5:58
Member 1496877116-Feb-23 5:58 
GeneralRe: How to manage application configuration ? Pin
jschell16-Feb-23 6:47
jschell16-Feb-23 6:47 
QuestionMessage Closed Pin
10-Feb-23 14:24
Member 1496877110-Feb-23 14:24 
AnswerRe: Passing a pointer to object - using template - followup. Pin
Graham Breach10-Feb-23 21:35
Graham Breach10-Feb-23 21:35 
AnswerRe: Passing a pointer to object - using template - followup. Pin
Richard MacCutchan10-Feb-23 21:55
mveRichard MacCutchan10-Feb-23 21:55 
AnswerRe: Passing a pointer to object - using template - followup. Pin
CPallini10-Feb-23 23:24
mveCPallini10-Feb-23 23:24 
AnswerRe: Passing a pointer to object - using template - followup. Pin
jschell13-Feb-23 4:55
jschell13-Feb-23 4:55 
GeneralMessage Closed Pin
13-Feb-23 5:10
Member 1496877113-Feb-23 5:10 
GeneralRe: Passing a pointer to object - using template - followup. Pin
Richard MacCutchan13-Feb-23 5:37
mveRichard MacCutchan13-Feb-23 5:37 
GeneralRe: Passing a pointer to object - using template - followup. Pin
k505413-Feb-23 6:31
mvek505413-Feb-23 6:31 
GeneralRe: Passing a pointer to object - using template - followup. Pin
Gerry Schmitz13-Feb-23 6:43
mveGerry Schmitz13-Feb-23 6:43 
GeneralRe: Passing a pointer to object - using template - followup. Pin
jschell14-Feb-23 4:44
jschell14-Feb-23 4:44 
GeneralRe: Passing a pointer to object - using template - followup. Pin
jschell14-Feb-23 4:47
jschell14-Feb-23 4:47 
AnswerRe: Passing a pointer to object - using template - followup. Pin
Jeremy Falcon13-Feb-23 12:43
professionalJeremy Falcon13-Feb-23 12:43 
GeneralMessage Closed Pin
14-Feb-23 4:24
Member 1496877114-Feb-23 4:24 
GeneralRe: Passing a pointer to object - using template - followup. Pin
Jeremy Falcon14-Feb-23 5:34
professionalJeremy Falcon14-Feb-23 5:34 
Questionxxx_GetProcessIndexFromID error... Pin
charlieg10-Feb-23 11:46
charlieg10-Feb-23 11:46 

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.