Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help converting STRUCT to VFP string
Message
De
05/11/1998 19:38:04
 
 
À
05/11/1998 16:35:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00155020
Message ID:
00155069
Vues:
24
>Can anyone provide some insight in converting structs and pointers to VFP strings ? I am trying to use a call to the HTML help object to display a popup with the following syntax:
>
>HTMLHelp(0,"",HH_DISPLAY_TEXT_POPUP, @lpHH_POPUP)
>
>I need to pass a pointer HH_POPUP structure to this function as the last parameter, which is what I am stuck on. The structure of the popup is as follows:
>
>typedef struct HH_POPUP
>{
>int cbStruct;
>HINSTANCE hinst;
>UINT idString;
>LPCTSTR pszText;
>POINT pt;
>COLORREF clrForeground;
>COLORREF clrBackground;
>RECT rcMargins;
>LPCTSTR pszFont;
>} HH_POPUP;

"pt" is not a pointer to a POINT struct, but a POINT struct embedded in HH_POPUP. The same goes for RECT.

int - 4 bytes
HINSTANCE - 4 bytes
UINT - 4 bytes
LPCTSTR - 4 bytes
POINT - 8 bytes
COLORREF - 4 bytes
RECT - 16 bytes

So, the length of the struct is 13 x 4 = 52 bytes.

Vlad

>I know that pt is a pointer to a POINT structure, which is defined as two LONGs that hold the X and Y co-ordinates of the cursor. The RECT structure is 4 LONGS that store the co-ordinates of the window to create. The pszText and pszFont are pointers to strings, if I am following this correctly.
>
>How (or CAN) I map this structure to a VFP string ? I have tried some routines I found here and in some books I have but have had no luck. Also, the cbStruct INTEGER needs to contain the size of the structure, how would I figure this out ? Is it impossible to pass this ???
>
>Thanks
>Rob
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform