Quote Originally Posted by invaderjolleyolleyman View Post
and I'm creating one dynamically via:
VTXMENU *fish;
fish = new VTXMENU;


not only do my strings end up full of garbage, but the message "created" is never displayed

Why is this happening?
thx
Is VTXMENU a struct or a class? I'm not sure if I correctly interpreted the wording, but it seems like VC++ treats structs and classes differently when you create an object with new as you do.
http://msdn.microsoft.com/en-us/libr...(v=VS.80).aspx
Quote Originally Posted by MSDN
If an object is of a class type and that class has constructors (as in the preceding example), the object can be initialized by the new operator only if one of these conditions is met:
- The arguments provided in the initializer agree with those of a constructor.
- The class has a default constructor (a constructor that can be called with no arguments).
It seems like "class type" does not include a struct and, therefore, your object is not initialized when you call new like this. To make sure the default constructor is called use this instead:
Code:
VTXMENU *fish = new VTXMENU();