Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Loading File
Message
 
À
23/08/2007 13:34:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01249743
Message ID:
01250099
Vues:
21
Hi Rich,

>Any ideas on how to resolve this particular problem?

Most likely you can only solve the problem by editing the parent class and removing all columns.

The problem is the way VFP stores a container class like the grid. Most classes only have one record in the VCX file. Grids, however, have multiple records. One for the grid, and one for each header and textbox that you add as part of the column in this particular instance.

When you start with a grid class that has the default column count of -1, you end up with a class that has only one record. Now you subclass this class and change the record count to 10. VFP creates one record for the grid and 20 records for Header1 and Text1 objects. The first record of each class is the class record. VFP loads a class by first loading the parent entirely. Right now this would be the one record from the parent class. Next, VFP applies the class record to alter any property in any of the controls of the parent classes. Finally, it processes all remaining records and adds them. Any record except the first one is a new control in a subclass.

The problem starts when you modify the parent and add columns. This increases the record count from 1 to whatever. When VFP now loads the subclass it first loads the parent class. Now this involves the class record as well as any of added control records. The grid does now have the specified number of columns along with their header1 and text1 controls. Next, VFP applies the class record of your subclass and proceeds with adding all additional records. What you end up with is a grid that has multiple Text1 controls. Header objects are filtered out, because there can only be one per column.

VFP loads this just fine. You can even see them in the properties window. However, when you try to save this class, VFP errors out with the message that you get, because it cannot deal with multiple objects having the same name.
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform