Budi Irawan wrote: > Oh, it is because i didn't add dynamic class.......but I don't really > understand why I have to add it. It is really tricky because I had been > trying to find why my Load function didn't work for several hours. > > Based on wxWidgets Doc, it said that > > "Used in a C++ implementation file to complete the declaration of a > class that has run-time type information, and whose instances can be > created dynamically" > > Do you know why, Klaas?
Its the attribute classname in CVG, like e.g. in canobj.cpp:5722 wxString classname = parser.GetAttributeValue( wxT("classname") ); a2dCanvasObject* object = wxDynamicCast( parser.CreateObject( classname ), a2dCanvasObject ); This creates a child a2dCanvasObject, because it knows the classname, and using run-time type information, it can create such an object. Next in a2dObject::Load and derived etc., this object is filled with the information it had. Klaas Unclassified ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Wxart2d-users_dev mailing list Wxart2d-users_dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev