Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Documentation bug for sys(2325)
Message
De
02/01/2005 04:31:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00973562
Message ID:
00973686
Vues:
30
>Hi All,
>
>>>No. SYS(2325, whandle) returns the hWnd (Windows handle) if the window in question.
>>
>>George !!!!
>>
>>Then, explain because next line print 0 !
>>
>>? SYS(2326,SYS(2325,SYS(2326,_VFP.HWnd)))
>>
>>
>>Fabio
>
>I think that Fabio wants to point out this issue:
>
>
>* The results are coming from my test-setup, your numbers vary
>* hWnd's
>? _screen.HWnd           &&2164384
>? _vfp.HWnd              &&591304
>* WHANDLE's
>? SYS(2326,_vfp.HWnd)    &&21629216
>? SYS(2326,_screen.HWnd) &&21629236
>
>* What fabio wants to say is that the documentation states that
>* the first statement is correct
>* But the second one is implemented and the intellisense
>* entry shows this behaviour as the description
>? _screen.HWnd=SYS(2325,SYS(2326,_vfp.HWnd))
>? _screen.HWnd=SYS(2327,SYS(2325,SYS(2326,_vfp.HWnd)))
>
>* Lets take a closer look:
>? SYS(2325,SYS(2326,_vfp.HWnd)) &&21629236
>* Gives me the same result as:
>? SYS(2326,_screen.HWnd) &&21629236
>* Which is the WHANDLE from _screen
>
>
>So for me SYS(2325) does return a WHANDLE. It is very important that we agree on this one.
>
>But the documentation states:
>SYS(2325, nWHANDLE)
>Returns the hWnd of a client window from the parent window's WHANDLE.
>
>and the intellisence entry states:
>Given an integer nWhandle which is a WHANDLE to a FoxPro window, returns the WHANDLE of the WCLIENTWINDOW. For use primarily with BINDEVENT() scenarios involving Visual FoxPro Library Contruction Kit APIs.
>
>And I agree with Fabio that the implementation is correct, but the
>documentation is wrong.
>
>FWIW, SYS(2326) and SYS(2327) are complementing each other:
>
>
>? _VFP.HWnd,SYS(2327,SYS(2326,_VFP.HWnd))
>? _screen.HWnd,SYS(2327,SYS(2326,_screen.HWnd))
>
>
>So if I need the hWnd of the WHANDLE, I can use SYS(2327) to convert the WHANDLE to a hWnd.
>
>Regards,

Hi Frank,
you have explained very well.

I could not believe that one developer of the VFPT could have defined one function in that way. Sin that who often writes the documentation does not think to what it writes.

In order to complete my point of view, I think that the design is not the
most efficient possible one.
With current design, 99.9% of the times
( the use of FoxPro Library Contruction Kit APIs is much rare one )
it will come written:
* I want the Hwnd of the Client Window
hClient = SYS(2327,SYS(2325,SYS(2326, AsTopForm.HWnd)))
BINDEVENT(m.hClient,SOMEMESSAGE,...)
I hope that in VFP9 SP1 it comes added, a function that do
SYS(2327,sys(2325,sys(2326
* Returns the hWnd of a client window from the parent window's hWnd.
  SYS(2328, nhWnd)
Fabio


Much best if the VFPT had made:

SYS(
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform