Click here to Skip to main content
15,906,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Changing an HICON's colour at runtime Pin
Monty219-Mar-06 21:56
Monty219-Mar-06 21:56 
GeneralRe: Changing an HICON's colour at runtime Pin
lastgen20-Mar-06 10:52
lastgen20-Mar-06 10:52 
QuestionHow to use WindowProc function Pin
nripun19-Mar-06 21:24
nripun19-Mar-06 21:24 
AnswerRe: How to use WindowProc function Pin
Nibu babu thomas19-Mar-06 21:28
Nibu babu thomas19-Mar-06 21:28 
AnswerRe: How to use WindowProc function Pin
_AnsHUMAN_ 19-Mar-06 22:38
_AnsHUMAN_ 19-Mar-06 22:38 
GeneralRe: How to use WindowProc function Pin
Monty219-Mar-06 23:11
Monty219-Mar-06 23:11 
AnswerRe: How to use WindowProc function Pin
Hamid_RT20-Mar-06 0:50
Hamid_RT20-Mar-06 0:50 
QuestionRuntime type checking help. Pin
Rostfrei19-Mar-06 21:00
Rostfrei19-Mar-06 21:00 
Greetings!

I know it's a long shot and please don't mock me if I missed it completely.

Suppose I get some config file called objects.txt. It includes lines like:

phonenum|1003
colour|red
vehicle|truck|mack

first string on the line is name of object type and all the rest are parameters. In my program I would like to read file objects.txt line by line and do the following:

if "I know-type" phonenum {
new phonenum(1003);
} else if "I know-type" colour{
new colour(red);
} else if "I know-type" vehicle{
new vehicle(truck, mack);
}

Is that even possible? To check the type at run-time?

Before you dissmiss me complitely I'd like to explain what I would like to achieve. Maybe you will know some other solution to the same problem.

I'd like to make some kind of save/load, serialize/deserialize framework. It would provide capability to store and load user defined objects. All objects would be serialized and stored in one file (configuration for the whole user defined system). Framework would gather ojects trough some common interface

addObj(abstractObj obj*);

every user defined object would have to implement methods

char* serialize(void);
void deserialize(char*);

when framework is asked to save objects, it would call "serialize" method of all objects it contains and save them line by line. When framework is asked to load configuration he would read the file line by line and read the type of object and create it, than call its "deserialize" method with the rest of the line characters.

I already used the serialize/deserialize pattern before. But in that particular implementation I knew all the types compile time. For example:

if (line == "phonenum"){
new phonenum(1002);
}
...

here I already know what types I expect. I'd like to do implementation when I don't already know all the names infront at compile time. I'd like to read the "name" run-time and check if I know it. This way I'd really have true framework which should not know any user defined types at compile time.

Best regards,

Rostfrei
AnswerRe: Runtime type checking help. Pin
Nibu babu thomas19-Mar-06 21:12
Nibu babu thomas19-Mar-06 21:12 
GeneralRe: Runtime type checking help. Pin
Rostfrei19-Mar-06 21:28
Rostfrei19-Mar-06 21:28 
AnswerRe: Runtime type checking help. Pin
Monty219-Mar-06 21:14
Monty219-Mar-06 21:14 
GeneralRe: Runtime type checking help. Pin
Rostfrei19-Mar-06 21:26
Rostfrei19-Mar-06 21:26 
QuestionFolder lock Pin
pratap12319-Mar-06 20:54
pratap12319-Mar-06 20:54 
AnswerRe: Folder lock Pin
Nibu babu thomas19-Mar-06 20:59
Nibu babu thomas19-Mar-06 20:59 
GeneralRe: Folder lock Pin
J512198220-Mar-06 17:06
J512198220-Mar-06 17:06 
GeneralRe: Folder lock Pin
Nibu babu thomas20-Mar-06 17:07
Nibu babu thomas20-Mar-06 17:07 
GeneralRe: Folder lock Pin
J512198221-Mar-06 17:25
J512198221-Mar-06 17:25 
QuestionProblem with member static data initialization win32 DLL Pin
Divick19-Mar-06 20:40
Divick19-Mar-06 20:40 
AnswerRe: Problem with member static data initialization win32 DLL Pin
Nibu babu thomas19-Mar-06 20:54
Nibu babu thomas19-Mar-06 20:54 
GeneralRe: Problem with member static data initialization win32 DLL Pin
Divick20-Mar-06 1:00
Divick20-Mar-06 1:00 
GeneralRe: Problem with member static data initialization win32 DLL Pin
Nibu babu thomas20-Mar-06 1:08
Nibu babu thomas20-Mar-06 1:08 
QuestionWhiteSky and Nibu Thomas Pin
Shoaib Patel19-Mar-06 20:39
Shoaib Patel19-Mar-06 20:39 
QuestionPicturebox paint event Pin
Engineer Masood19-Mar-06 20:05
Engineer Masood19-Mar-06 20:05 
AnswerRe: Picturebox paint event Pin
Nibu babu thomas19-Mar-06 20:10
Nibu babu thomas19-Mar-06 20:10 
GeneralRe: Picturebox paint event Pin
Engineer Masood19-Mar-06 20:15
Engineer Masood19-Mar-06 20:15 

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.