---------------------------------------------------------------------------
                      VFP 9.0 FIX - THE SELECTED REPORT OBJECTS ARE PRINTED WITH SHADOW
                                 January 2019
                 ---------------------------------------------------------------------------
                                     CCB



1. BUG:

     In vfp9, if we select some report objects and save the report file, it will set the CURPOS field to true (.T.) for the selected report objects.
     When we run the report in the preview window, the selected report objects are printed with shadow.

     The bug only occurs in vfp9, it does not occur in vfp6, vfp7 and vfp8.

     The bug only occurs when set ReportBehavior 80, it does not occur when set ReportBehavior 90.

     In vfp9, it will show some shadow in the preview window, please refer to the picture testshadow0-vfp9.jpg:

     and then, it will show the report in the preview window, please refer to the picture testshadow-vfp9.jpg:


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Fun48f7f6 :: ; proc near
             push ebp                                                        ;0x0048f7f6 :        55
             mov ebp , esp                                                   ;0x0048f7f7 :        8bec
             sub esp , 013Ch                                                 ;0x0048f7f9 :        81ec3c010000
             mov eax ,  dword ptr [ Data937090 ]                             ;0x0048f7ff :        a190709300
             mov  dword ptr [ ebp - 4 ] , eax                                ;0x0048f804 :        8945fc
             pushd 043h                                                      ;0x0048f807 :        6a43
             lea ecx ,  dword ptr [ ebp + 0FFFFFEC8h ]                       ;0x0048f809 :        8d8dc8feffff
             call Fun43c868                                                  ;0x0048f80f :        e854d0faff


     ;
     ;                 ---------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - THE SELECTED REPORT OBJECTS ARE PRINTED WITH SHADOW
     ;                                 October 2018
     ;                 ---------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, if we select some report objects and save the report file, it will set the CURPOS field to true (.T.) for the selected report objects.
     ; When we run the report in the preview window, the selected report objects are printed with shadow.
     ; In VFP Advanced, it will ALWAYS use the CURPOS field as false (.F.), so there is no the shadow in the preview window.
     ;
     ;
     ; 2018/10/7, by ccb
     ;

             cmp dword ptr vfpa_report_isreportform,00h
             je Label48f814
             cmp  byte ptr [ Data93c280 ] , 05Ah
             jae Label48f814
             mov  dword ptr [ ebp + 0FFFFFED0h ] , 00h


     Label48f814 ::
             mov  ecx , dword ptr [ ebp + 8 ]                                ;0x0048f814 :        8b4d08
             mov  ecx , dword ptr [ecx]                                      ;0x0048f817 :        8b09
             xor eax , eax                                                   ;0x0048f819 :        33c0
             cmp  dword ptr [ ebp + 0FFFFFED0h ] , eax                       ;0x0048f81b :        3985d0feffff
             setne al                                                        ;0x0048f821 :        0f95c0
             mov  dword ptr [ ecx + 48 ] , eax                               ;0x0048f824 :        894130
             mov  ecx , dword ptr [ ebp - 4 ]                                ;0x0048f827 :        8b4dfc
             call Fun42bf1d                                                  ;0x0048f82a :        e8eec6f9ff
             leave                                                           ;0x0048f82f :        c9
             ret 04h                                                         ;0x0048f830 :        c20400

     Now in VFP Advanced, it will ALWAYS use the CURPOS field as false (.F.), so there is no the shadow in the preview window.
     Please refer to the picture testshadow-vfpa.jpg:


4. APPLIES TO:

     VFP 9.0.0.2412
     VFP 9.0.0.3504 (SP1)
     VFP 9.0.0.4611 (SP2)
     VFP 9.0.0.5015 (SP2)
     VFP 9.0.0.5411 (SP2)
     VFP 9.0.0.5721 (SP2)
     VFP 9.0.0.5815 (SP2)
     VFP 9.0.0.6303 (SP2)
     VFP 9.0.0.6602 (SP2)
     VFP 9.0.0.7423 (SP2)

     The bug has been fixed in VFP Advanced.


5. REFERENCE WEBSITES:

     1, baiyujia.com:
     http://www.baiyujia.com

     2, mattslay.com:
     http://www.mattslay.com/pages/FoxPro-Report-FRX-Structure.html

     3, foxcentral.com:
     http://www.foxcentral.net/microsoft/WhatsNewInVFP9_Chapter06.htm


6. OTHER:

     For reference only, there is no guarantees.

     Any questions or suggestions, please send me an email at ccb2000@163.com.