Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid does not recognize its column member
Message
From
26/06/1998 21:56:58
 
 
To
26/06/1998 13:18:13
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00111987
Message ID:
00112129
Views:
19
>I am encountering some strange behavior that has me baffled. I am debugging a form, with a container that contains a grid. In the Init method of the grid I set some column properties with the statement:
>
>THIS.ColP1.DynamicFontName = "THIS.Parent.GetDynaFont()"
>THIS.ColP2.DynamicFontName = "THIS.Parent.GetDynaFont()"
>etc.
>
>This runs fine for the first three to five of times that I RUN the form. Then, for no reason that I can determine, I will get an 'Unknown member COLP1' error when I try to load it the next time. The debugger says that the grid Init method is the current routine in the call stack and when I examine 'THIS' in the watch window, it has an object ColP1 in its heirarchy which I can expand and verify that it has a name of "ColP1"
>
>It is behaving as though the column object has not been instantiated yet, even though the debugger says that it has. I can solve the problem by quitting FoxPro and starting it again, but ultimately I need to find what is causing the difficulty and eliminate it, so that it won't happen in production.
>
>Any suggestions?
>
>Pamela


Hi, Pamela.

I have come across similar situation. I wonder that anytime I reassign the
grid.recordsource. All the object in grid will be released!!
Then, the grid will relocate the New Object and all the properties will reset
to Default!!

This is NOT an Error! Grid should carry Dynamic Object.
When unused, the object should be released including header, column, text1...
So, What can we do?!
Try to make a New Procedure for Grid instead of using .init()
e.g. InitTask()
So, you can free reassign the grid object at this procedure even
remove text1 and add textNoIme again...
Because there is a Known Ime mode problem in grid at executable file!

Then, once you need to reassign the recordsource, just recall the InitTask()
everything will do as you wish even fonts size, grid row height, column
height...



Finally, I would remind you that Don't use the command:
SET FIELD TO or CurFIELDLIST = SET("FIELD",1)
at CreateObject() version. This will be totally different from DO FORM Version!
Of cos, the value return is also different in VFP tracing and Use RUNTIME DLL
to run .exe!!

Beware! ^_~ Good Luck!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Reply
Map
View

Click here to load this message in the networking platform