Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bob Brook
  Where is Bob Brook?
 Surrey
 United Kingdom
 Bob Brook
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Totals at bottom of Grids
Thread ID: 396043 Message ID: 396064 # Views: 55 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Wednesday, January 22, 2014 4:34:42 PM         
   


> > I have recently added Peter Sass's grid totals grid to forms in my applications.
> > They work(ed) fine and I set the default height of the totgrid to 20px and would increase it to the height of the rows in the main grid plus twice the line height.
> >
> > On XP and some Windows 7 OS PC's this works without problem.
> >
> > Yesterday, received error messages numbered 2005 from a client using Windows 7.
> >
> > On investigation it turns out that the minimum height I was using of 20 was causing the error. If I set the totgrid classes height to 40 and in the SetPosition method use a Do Loop and a Try Catch EndTry structure on setting the totgrid height for an actual form with an incrementing variable to slowly increase the grids height. It overcomes the problem.
> >
> > On my XP system if I try to set a grid height of less than 20 under VFP - it gives an error.
> > This is the 2005 error that the end user gets when running the program.
> >
> > I suppose my question is: why for some operating systems, what is in their environment that could cause a 2005 error on some PC's but not on others. It may also be a problem for some Windows 8 PC's but as yet none have reported an error.
> >
> > I suspected the style/type of Window display being used, but on changing to Windows Classic or Windows XP under the Control Panel, has no effect on the error.
> >
> >
> > Regards
> >
> > Bob of Surrey, England
>
>
>
> FWIW, when I'm getting Error 2005, I'm usually suspecting custom Resize() code being used instead of the Anchoring feature in the first place, and that Resize() code assigning illegal values.
> So that perhaps something like the customizable scroll bar width / height in Windows display properties may for example make a difference for something like a Grid in Form.Resize()
>
>
> * In a quick&dirty test, in TestForm.Resize() this one caused error 2005 when the Form got small:
> Thisform.Grid1.Move( ;
> 	10, ;
> 	10, ;
> 	Thisform.Width - 20, ;
> 	Thisform.Height - 20 ;
> 	)
> 
> * This one did not:
> Thisform.Grid1.Move( ;
> 	10, ;
> 	10, ;
> 	MAX(Thisform.Width - 20, 20 + SYSMETRIC(5)), ;
> 	MAX(Thisform.Height - 20, 20 + SYSMETRIC(8)) ;
> 	)
> 

>
>
>
> hth
> -Stefan
Stefan,
The 2005 error code is being received even before the Init or Load methods of the form. The only way I could duplicate the error was to change the class library file extensions to those of a table; edit the Memo field containing the initial property values to a small height size. Put the file extensions back to those of a library and then re-compile the application. Then on opening a form I got the 2005 error code on the DoForm command. When I tried to put the height back to an acceptable value within the project, it would not open the class - giving an invalid value error. So I had to change it back to a table, do the manual edit and re-set as a class.

So I believe it is happening before any form methods are called and on initial opening of the grid class within the form.

These are the Stack level calls:
1 Proc. aaa_app && main application
2 Proc. app_application.show
3 Proc. app_application.activate
4 Proc. app_application.readevents
5 Proc. usertoolbar.utb_fixedassetlist.click && menu option
6 Proc. openform && procedure to call DoForm
7 Proc. app_application.doform
8 Proc. app_application.error
9 Proc. app_application.cuserror.handle

Error message being
Message Error loading file - record number 32. Sv_gridtots1 . Parent : Error with sv_gridtots - Height : Expression evaluated to an illegal value (ERROR LOADING FILE - RECORD NUMBER 32. SV_GRIDTOTS1 . PARENT : ERROR WITH SV_GRIDTOTS - HEIGHT : EXPRESSION EVALUATED TO AN ILLEGAL VALUE)

Record 32 being the number of the Gridtots class record within the class (table) file.



Regards

Bob of Surrey, England

ENTIRE THREAD

Totals at bottom of Grids Posted by Bob Brook @ 1/22/2014 2:14:53 PM
RE: Totals at bottom of Grids Posted by Stefan Wuebbe @ 1/22/2014 3:00:58 PM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/22/2014 4:34:42 PM
RE: Totals at bottom of Grids Posted by Pete Sass @ 1/22/2014 7:21:34 PM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/22/2014 8:41:16 PM
RE: Totals at bottom of Grids Posted by Pete Sass @ 1/22/2014 9:37:49 PM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/23/2014 11:22:21 AM
RE: Totals at bottom of Grids Posted by Vicos Vicos @ 1/24/2014 10:59:09 PM
RE: Totals at bottom of Grids Posted by Ilyas Ansar @ 1/24/2014 2:36:16 AM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/24/2014 11:24:20 AM
RE: Totals at bottom of Grids Posted by Bob Brook @ 1/24/2014 1:10:24 PM