make data retrieved once, and be available to the whole application
-
I have to read some data from the registry, and will need to use it several times in probably all the parts of my application. So instead of reading it from the registry every time I need it, I would like to read it once and make it available to all the application parts. How can I do that? :confused:I thought about the Document class but I have more dialogs that can't access this one. Thanks
-
I have to read some data from the registry, and will need to use it several times in probably all the parts of my application. So instead of reading it from the registry every time I need it, I would like to read it once and make it available to all the application parts. How can I do that? :confused:I thought about the Document class but I have more dialogs that can't access this one. Thanks
create a registry class with static member variables.
-
I have to read some data from the registry, and will need to use it several times in probably all the parts of my application. So instead of reading it from the registry every time I need it, I would like to read it once and make it available to all the application parts. How can I do that? :confused:I thought about the Document class but I have more dialogs that can't access this one. Thanks
Make the data global. The simplest thing to do is to place it in
stdafx.h
, marking the declarations with theextern
keyword. In the main program, where you retrieve the data from the registry, repeat the declarations without theextern
keyword.
Software Zen:
delete this;
-
create a registry class with static member variables.
I was thinking in CWinApp and CDocument, and forgot that I can make my OWN class. :-O :-O Thanks :rose:
-
Make the data global. The simplest thing to do is to place it in
stdafx.h
, marking the declarations with theextern
keyword. In the main program, where you retrieve the data from the registry, repeat the declarations without theextern
keyword.
Software Zen:
delete this;
Done it with this method in 3 minutes. :omg: :-D Thanks a lot :rose:
-
Done it with this method in 3 minutes. :omg: :-D Thanks a lot :rose:
You're welcome. :)
Software Zen:
delete this;