P
Peter Oliphant
While I really like VS C++.NET 2005, there are a number of tasks which are
harder than they should be. Conversion from old 'char' arrays to new String
entities for instance. This thread is to list problems that seem like they
should be easy, but are a bit kludgy. Then solutions can be pointed to or
described! I'll begin:
(*) It is not easy to create a mouse cursor based on an arbitrary bitmap,
even one with restrictions such as dimensional size and use of colors. In
fact, it is tough to customize a mouse cursor in general.
(*) It is tough to insert a single character into a String. As a corollary,
it is tough to convert a single character into a String (Note: ToString
doesn't do this).
(*) It is tough to create an array of objects INSTANCES based on custom
classes. It is easy to create an array of POINTERS to custom objects, but an
array of custom objects have to be VALUE objects and not REF objects. Thus,
they can't have constructors or any other method as part of their definition
(they are what old 'structs' use to be, data but no code).
(*) It requires a sub-system to place a simple shape (e.g., solid-colored
box) on the screen permanently (that is, not only does one have to put code
in the Paint even handler to be run every screen refresh, but one must
actually manually refresh the portion of the screen when and where there are
any changes for them to be seen).
(*) The lack of multiple inheritance means one can't customize innate
controls 'en mass". That is, I can't create a class that Form's AND Panel's
can both inherent from as a common basis. For example, if I want to add a
Graphic sub-system ala the above item I need to put the code in both custom
classes and inherit only from the control's. I can't create a
'GraphicHandler' class and define two new classes, one that derives from
Form and GraphicHandler, and one that derives from Panel and Graphics
handler. I can do this with composition, however, but its not as clean and
requires code to 'bring up' the functionality of the composited sub-class.
I'll try to think of some more...
[==P==]
harder than they should be. Conversion from old 'char' arrays to new String
entities for instance. This thread is to list problems that seem like they
should be easy, but are a bit kludgy. Then solutions can be pointed to or
described! I'll begin:
(*) It is not easy to create a mouse cursor based on an arbitrary bitmap,
even one with restrictions such as dimensional size and use of colors. In
fact, it is tough to customize a mouse cursor in general.
(*) It is tough to insert a single character into a String. As a corollary,
it is tough to convert a single character into a String (Note: ToString
doesn't do this).
(*) It is tough to create an array of objects INSTANCES based on custom
classes. It is easy to create an array of POINTERS to custom objects, but an
array of custom objects have to be VALUE objects and not REF objects. Thus,
they can't have constructors or any other method as part of their definition
(they are what old 'structs' use to be, data but no code).
(*) It requires a sub-system to place a simple shape (e.g., solid-colored
box) on the screen permanently (that is, not only does one have to put code
in the Paint even handler to be run every screen refresh, but one must
actually manually refresh the portion of the screen when and where there are
any changes for them to be seen).
(*) The lack of multiple inheritance means one can't customize innate
controls 'en mass". That is, I can't create a class that Form's AND Panel's
can both inherent from as a common basis. For example, if I want to add a
Graphic sub-system ala the above item I need to put the code in both custom
classes and inherit only from the control's. I can't create a
'GraphicHandler' class and define two new classes, one that derives from
Form and GraphicHandler, and one that derives from Panel and Graphics
handler. I can do this with composition, however, but its not as clean and
requires code to 'bring up' the functionality of the composited sub-class.
I'll try to think of some more...
[==P==]