Click here to Skip to main content
15,898,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVisual C++ Debugger Macros and Add-Ins Pin
BootMan25-Feb-02 6:50
BootMan25-Feb-02 6:50 
GeneralRe: Visual C++ Debugger Macros and Add-Ins Pin
J Patel25-Feb-02 11:43
J Patel25-Feb-02 11:43 
Generaltooltips - how to retrieve the text Pin
deejay25-Feb-02 6:34
deejay25-Feb-02 6:34 
GeneralRe: tooltips - how to retrieve the text Pin
Jeremy Falcon25-Feb-02 9:04
professionalJeremy Falcon25-Feb-02 9:04 
GeneralRe: tooltips - how to retrieve the text Pin
deejay26-Feb-02 0:28
deejay26-Feb-02 0:28 
GeneralRe: tooltips - how to retrieve the text Pin
deejay28-Feb-02 5:17
deejay28-Feb-02 5:17 
GeneralGlobal variable clarifications Pin
dazinith25-Feb-02 6:01
dazinith25-Feb-02 6:01 
GeneralRe: Global variable clarifications Pin
Joaquín M López Muñoz25-Feb-02 6:15
Joaquín M López Muñoz25-Feb-02 6:15 
If I'm understanding your requirements, maybe the design pattern called singleton is what you're looking for. A singleton is special class that ensures that there is only one instance of it in the program. One of its most usual layouts is as follows:
//singleton.h
class singleton
{
  public:
    static singleton * get_instance();
  private:
    singleton(); // private ctor, ensures the only way to get a singleton
                 // is thru get_instance.
    singleton * instance;
};
//singleton.cpp
singleton * singleton::instance=0;
 
singleton * singleton::get_instance()
{
  if(!singleton){ // first time initialization
    singleton = new singleton();
  }
  return singleton;
}
 
singleton::singleton()
{
  // initialization stuff.
}
(Note that this implementation does not ever delete instance which could be a problem on some cases.)
If you turn your CObArray into a singleton then you're guaranteeing that the parsing is only done once (or never if nobody happens to call get_instance) and provide centralized access to the information.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Global variable clarifications Pin
Jon Hulatt25-Feb-02 6:21
Jon Hulatt25-Feb-02 6:21 
GeneralRemove CDialogBar Border Pin
Brian V Shifrin25-Feb-02 6:05
Brian V Shifrin25-Feb-02 6:05 
GeneralOle drag and drop Pin
cycosi25-Feb-02 5:31
cycosi25-Feb-02 5:31 
GeneralMDI Question Pin
RobJones25-Feb-02 4:54
RobJones25-Feb-02 4:54 
GeneralRe: MDI Question Pin
Carlos Antollini25-Feb-02 5:06
Carlos Antollini25-Feb-02 5:06 
GeneralRe: MDI Question Pin
RobJones25-Feb-02 5:12
RobJones25-Feb-02 5:12 
GeneralRe: MDI Question Pin
Carlos Antollini26-Feb-02 3:31
Carlos Antollini26-Feb-02 3:31 
GeneralProblem about serialization and filename Pin
Charles Liu25-Feb-02 4:36
Charles Liu25-Feb-02 4:36 
GeneralThe procedure entry point could not be located Pin
Rubio25-Feb-02 4:04
Rubio25-Feb-02 4:04 
GeneralRe: The procedure entry point could not be located Pin
Cliff Dabrowski25-Feb-02 4:37
Cliff Dabrowski25-Feb-02 4:37 
GeneralRe: The procedure entry point could not be located Pin
Michael Dunn25-Feb-02 7:35
sitebuilderMichael Dunn25-Feb-02 7:35 
GeneralRe: The procedure entry point could not be located Pin
Tim Deveaux25-Feb-02 7:43
Tim Deveaux25-Feb-02 7:43 
GeneralMSN Messenger Send Message To Pin
25-Feb-02 3:55
suss25-Feb-02 3:55 
GeneralRe: MSN Messenger Send Message To Pin
Michael P Butler25-Feb-02 4:07
Michael P Butler25-Feb-02 4:07 
GeneralRe: MSN Messenger Send Message To Pin
Michael Dunn25-Feb-02 7:43
sitebuilderMichael Dunn25-Feb-02 7:43 
GeneralRe: MSN Messenger Send Message To Pin
octopussy26-Feb-02 3:29
octopussy26-Feb-02 3:29 
GeneralRe: MSN Messenger Send Message To Pin
Michael Dunn26-Feb-02 7:55
sitebuilderMichael Dunn26-Feb-02 7:55 

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.