Click here to Skip to main content
15,671,838 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiona question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 0:16
Hamed Musavi25-Feb-06 0:16 
AnswerRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 0:29
Stephen Hewitt25-Feb-06 0:29 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 0:42
Hamed Musavi25-Feb-06 0:42 
GeneralRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 0:56
Stephen Hewitt25-Feb-06 0:56 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:07
Hamed Musavi25-Feb-06 1:07 
GeneralRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 1:19
Stephen Hewitt25-Feb-06 1:19 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:29
Hamed Musavi25-Feb-06 1:29 
GeneralRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 2:37
Stephen Hewitt25-Feb-06 2:37 
If I understand you correctly you want to load or save any type with calls such as this:
// Types to load/save
int Type1;
double Type2;
MyStruct Type3;
 
// To save
mySettings.Save(Type1);
mySettings.Save(Type2);
mySettings.Save(Type3);
 
// To load
mySettings.Load(Type1);
mySettings.Load(Type2);
mySettings.Load(Type3);


In C++ you could do this with template functions:
class CSettings
{
public;
 // Other stuff here.
 
     template<class T> void Save(T& SaveMe)
     {
         SaveTheData(reinterpret_cast<void*>(&SaveMe), sizeof(SaveMe));
     }
     template<class T> void Load(T& LoadMe)
     {
         LoadTheData(reinterpret_cast<void*>(&LoadMe), sizeof(LoadMe));
     }
 
 // Other stuff here.
};


Steve
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 20:15
Hamed Musavi25-Feb-06 20:15 
QuestionRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:09
Hamed Musavi25-Feb-06 1:09 
AnswerRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 1:12
Stephen Hewitt25-Feb-06 1:12 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:20
Hamed Musavi25-Feb-06 1:20 
GeneralRe: a question that did not get any true answer :(( Pin
toxcct25-Feb-06 9:00
toxcct25-Feb-06 9:00 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 20:24
Hamed Musavi25-Feb-06 20:24 
GeneralRe: a question that did not get any true answer :(( Pin
BadKarma25-Feb-06 23:11
BadKarma25-Feb-06 23:11 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi26-Feb-06 2:38
Hamed Musavi26-Feb-06 2:38 
NewsI thought about a soloution. Pin
Hamed Musavi25-Feb-06 1:44
Hamed Musavi25-Feb-06 1:44 
QuestionColor picker extension Pin
Hans Dietrich25-Feb-06 0:05
mentorHans Dietrich25-Feb-06 0:05 
AnswerRe: Color picker extension Pin
Blake Miller27-Feb-06 6:05
Blake Miller27-Feb-06 6:05 
QuestionSocket Communication Pin
kk.tvm24-Feb-06 21:24
kk.tvm24-Feb-06 21:24 
AnswerRe: Socket Communication Pin
Naveen24-Feb-06 22:19
Naveen24-Feb-06 22:19 
AnswerRe: Socket Communication Pin
Indivara25-Feb-06 1:33
professionalIndivara25-Feb-06 1:33 
AnswerRe: Socket Communication Pin
ThatsAlok26-Feb-06 21:31
ThatsAlok26-Feb-06 21:31 
QuestionDll Registration Problem Pin
Anil_vvs24-Feb-06 19:39
Anil_vvs24-Feb-06 19:39 
AnswerRe: Dll Registration Problem Pin
karle25-Feb-06 8:28
karle25-Feb-06 8:28 

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.