Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug: Using headerclass and memberclass
Message
De
13/01/2006 02:45:26
 
 
À
12/01/2006 20:04:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01086398
Message ID:
01086454
Vues:
30
This message has been marked as the solution to the initial question of the thread.
>In the process of changing from VFP 8.0 to 9.0sp1, we found the following issue.
>
>Basically in VFP 9sp1 we can not open any forms (scx) we created in VFP 8 that contains a grid that has memberclass with a headerclass if that grid had defined columns. Ie. Columncount greater than 0. We do not see the same issue with the forms that had the same grid and column/header definitions but a colunm count of 0 or less. And yes, we did recomplile the prg that contained the member/headerclass defs. The same exact forms continue to open just fine under vfp 8.
>
>This happens under the 9.0sp1 runtimes as well, with the exception that the erorr generated is related to an invalid foxref.dbf.
>
>We have tried (on seperate computers) opening the same project (this project is 2 years old and has never been moved) we can recompile and build the project on vfp8 with no issues. However when it is recompiled and built in vfp9 (with or without sp1), we get the error * Mheader1 Parent Class MHeader Definition not Found when trying to open any of above mentioned scx files.
>
>Anyone else seen this. Any Ideas?
>
>Jim
>
>
>* TO REPRODUCE UNDER VFP9.0SP1
>
>Before running this code Save the class defintions found below into a seperate prg named col_classes.prg. You will also need to change the paths accordingly. This code, creates a form, adds a grid and then set the memberclass and then sets the columncount = 2. It then saves the form and then tries to reopen it.
>
>Note: If you comment out the line .grid1.ColumnCount = 2 all works well.
>Note: If you comment out the HeaderClass/Libray lines in the classes all workS well.
>
>*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>* Prg to reproduce. Save to a seperate prg.
>*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>otestform = CREATEOBJECT("FORM")
>WITH otestform
>.CAPTION = "Test of MemberClass/HeaderClass for Grid Headers"
>.AddObject("grid1", "GRID")
>.grid1.MemberClassLibrary = 'col_classes.prg'
>.grid1.MemberClass = "grdcol"
>.grid1.ColumnCount = 2
>.grid1.Visible = .t.
>.Activate
>.Show
>.saveas("testof_header_class_form.scx")
>ENDWITH
>otestform.release
>otestform = ""
>* The following line will error out with an Error Loading File.....
>* Mheader1 Parent Class MHeader Definition not Found.
>MODIFY FORM testof_header_class_form.scx
>
>
>*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>* Member and Header Class Definitions.
>* Save the folowing class defintions in a seperate
>* prg named col_classes.prg and change the paths to
>* reflect the correct locations.
>*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>DEFINE CLASS grdcol AS COLUMN
>NAME               		= "MColumn"
>HEADERCLASSLIBRARY 		= "col_classes.prg"
>HEADERCLASS        		= "grdhdr"
>ENDDEFINE
>
>DEFINE CLASS grdhdr AS HEADER
>NAME     				= "MHeader"
>CAPTION  				= "Test Header"
>ENDDEFINE
many design's bugs and program's bugs are presents in VFP8/9 in reference to the memberclass property


When VFP load the member, it uses 3 names,
- memberclass name
- definition memberclass name
- instance member name

It load it with the memberclass name, but it assigns the name of the definition of class, and later only, it assign the definitive instance member name
( worse could not even be done wanting! );

the rule is:
"memberclass name" and "definition memberclass name" it has to be equal.

then,
with the following code, all the bugs (5-6) remain,
but the code becomes insensitive to them;
it work equal in VFP8/9.
ERASE "testof_header_class_form.*"

otestform = CREATEOBJECT("FORM")
WITH otestform
.CAPTION = "Test of MemberClass/HeaderClass for Grid Headers"
.AddObject("grid1", "GRID")
.grid1.MemberClassLibrary = SYS(16)
.grid1.MemberClass = "MColumn"
.grid1.ColumnCount = 2
.grid1.visible = .T.
.Show
.saveas("testof_header_class_form.scx")
ENDWITH
RELEASE otestform

MODIFY FORM testof_header_class_form.scx


DEFINE CLASS MColumn AS COLUMN		 && <<<<<<<<  same name
NAME               		= "MColumn"  && <<<<<<<<  same name
HEADERCLASSLIBRARY 		= SYS(16)
HEADERCLASS        		= "MHeader"
ENDDEFINE

DEFINE CLASS MHeader AS HEADER		 && same name
NAME     				= "MHeader"  && same name
CAPTION  				= "Test Header"
ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform