--------------------------------------------------------------------------
                      [BUG/PRB.] VFP 9.0 FIX - COMBOBOX CONTROL ENTER AN INFINITE LOOP
                                 January 2024
                 --------------------------------------------------------------------------
                                     CCB



1. BUG:

     For the ComboBox Control, sometimes (called some API Library functions?) VFP will enter an infinite loop.


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Label4eaf09 ::
             push esi                                                        ;0x004eaf09 :        56
             mov  esi , dword ptr [ Data9370f0 ]                             ;0x004eaf0a :        8b35f0709300
             add esi , 02Ch                                                  ;0x004eaf10 :        83c62c
             call Fun53cefe                                                  ;0x004eaf13 :        e8e61f0500


     ;
     ;                 ---------------------------------------------------------------
     ;                      VFP 9.0 FIX - COMBOBOX CONTROL ENTER AN INFINITE LOOP
     ;                                  March 2016
     ;                 ---------------------------------------------------------------
     ;                                     CCB
     ;
     ; For the ComboBox Control, sometimes (called some API Library functions?) VFP will enter an infinite loop.
     ;
     ; VFP initializes the Value.ev_type to "I" (Integer),
     ; but VFP does not initialize the Value.ev_long,
     ; so the Value.ev_long is a random number, sometimes (called some API Library functions?) it is a BIG random number,
     ; so VFP will enter an infinite loop.
     ;
     ; We can initialize the Value.ev_long to 0 (Zero) to fix the BUG.
     ;
     ; 2016/3/29, by ccb
     ;

             mov  dword ptr [ esi + 12 ] , 00h


             lea edx ,  dword ptr [ esp + 16 ]                               ;0x004eaf18 :        8d542410
             push edx                                                        ;0x004eaf1c :        52
             pushd 00h                                                       ;0x004eaf1d :        6a00
             pushd 039h                                                      ;0x004eaf1f :        6a39
             push edi                                                        ;0x004eaf21 :        57
             call Fun4ea4ba                                                  ;0x004eaf22 :        e893f5ffff
             mov  dword ptr [ebx] , eax                                      ;0x004eaf27 :        8903
             mov  eax , dword ptr [ esp + 16 ]                               ;0x004eaf29 :        8b442410
             test eax , eax                                                  ;0x004eaf2d :        85c0
             pop esi                                                         ;0x004eaf2f :        5e
             jne Label5f3d47                                                 ;0x004eaf30 :        0f85118e1000
             jmp Label4e3b57                                                 ;0x004eaf36 :        e91c8cffff


4. APPLIES TO:

     VFP 6.0.8167.0
     VFP 6.0.8961.0 (SP5)

     VFP 7.0.0.9262
     VFP 7.0.0.9465 (SP1)

     VFP 8.0.0.2521
     VFP 8.0.0.3117 (SP1)

     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
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix365.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix366.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix367.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix368.asp


6. OTHER:

     For reference only, there is no guarantees.

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