Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I pass a struct (like RECT) to an API function?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00172163
Message ID:
00172182
Vues:
22
Cristof,

You have to be very careful when attempting to use builtin properties like Top and Left of custom classes. I don't remember the exact circumstances, but VFP has a way of usurping those properties internally and screwing up the values you have put there.

>With this struct component, the RECT struct would be implemented in VFP like this:
>
>DEFINE CLASS RECT AS Struct
>  Left = 0
>  Top = 0
>  Right = 0
>  Bottom = 0
>  cMembers = "l:Left,l:Top,l:Right,l:Bottom"
>ENDDEFINE
>And you can use it like this:
>
> oRect = NEWOBJECT("RECT")
> LPRECT = oRect.GetString()
> APIFunction(@LPRECT)
> oRect.SetString(LPRECT)
> ? oRect.Left, oRect.Top, oRect.Right, oRect.Bottom
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform