Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to declare the FORM_INFO_1 Structure
Message
 
À
26/07/2001 12:11:15
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00535645
Message ID:
00536236
Vues:
8
>George,
>You are sure good natured. The rebuff you received about me using the STRUCT
>class should have read - 'He is TRYING to use the STRUCT class'.

OMG. You'll never believe what I spent my day writing today. :-)
DEFINE CLASS clsPrinterForms AS STRUCT
   DIMENSION aForms[1]
   cMembers = "o:aForms"

   nMemorySize = 100000  && Reserve memory for pointers

   PROCEDURE INIT
      This.aForms[1] = CREATEOBJECT("clsFormInfo")
      DODEFAULT()
   ENDPROC
ENDDEFINE

DEFINE CLASS clsFormInfo AS STRUCT
   flags = 0
   pName = ""      && form name
   Size = .NULL.   && paper size
   ImageableArea = .NULL.

   cMembers = "l:flags, pz:pName, o:size, o:imageableArea"

   PROCEDURE INIT
      This.Size  = CREATEOBJECT("clsSizeL")
      This.ImageableArea = CREATEOBJECT("clsRectL")
      DODEFAULT()
   ENDPROC
ENDDEFINE

DEFINE CLASS clsSizeL AS STRUCT
   cx = 0   && paper width
   cy = 0   && paper height

   cMembers = "l:cx, l:cy"
ENDDEFINE

DEFINE CLASS clsRectL AS STRUCT
   nLeft = 0
   nTop = 0
   nRight = 0
   nBottom = 0

   cMembers = "l:nLeft, l:nTop, l:nRight, l:nBottom"
ENDDEFINE
You'll need to use GetPointer and SetPointer instead of GetString and SetString. You'll also need to redimension the array once you find out how many forms you are putting in it.

Of course, nothing says I found the best way to do this. :-)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform