Let’s say I have a string with my class name inside:
mystring = "CDialogChild";
I would like to create an object of the type name written in my string.
I’d like to do something like:
CDialogParent dlg = CDialogParent(mystring);
My new dlg is now created as type CDialogChild and I can use its methods:
dlg.mycdialogchild_method();
There is nothing in C++ that will provide you such feature (called Reflection).
However, if your classes are of finite number, you can do some kind of mapping with some factories :
Or something similar (this is written quickly).
Alternatively you could work with a scripting language that would allow Reflection, but that would add a whole layer to your application. Scripting languages that might be of interest for embedding with c++ : ChaiScript, Falcon, Lua, Python, AngelScript, MonkeyScript, Io, …