Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More Problems with EnumForms
Message
 
To
02/08/2001 11:07:16
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00538518
Message ID:
00539508
Views:
20
>Garrett,
>I finally got the #@@!! EnumForms function to work, at least I thing I did.
>It tells me I have 122 forms defined on my resident printer. That does not
>seem correct but I guess there are a lot of defined label sizes etc. I am now
>stumped as to what to do with this information. You mentioned in your
>original posting about changing the dimension of the clsPrinterForms.aforms
>array when it was determined how many forms were involved. I don't understand
>the mechanisms of this. The code goes like this
>1. enumforms(....) - determine the size of the buffer
>2. create the clsprinter forms object
>3. do the getpointer funct on that object passing the required buffer size
>4. call enumforms again to get the number of forms.
>
>This only fills out 1 aforms structure. How do I fill out the other 121
>aforms structures?

Actually, you haven't filled out _any_ structure at this point: you have a pointer to the information. You haven't told the struct object to fill itself in from the pointer yet.
*!* When we defined the PrinterForms class, we didn't know how many forms
*!* were being returned. Now that we do, we need to re-dimension the array
*!* property to hold the proper number of forms, and get them ready to hold 
*!* the form information.
DIMENSION loForms.aForms[lnFormCount]
FOR i = 1 TO lnFormCount
   loForms.aForms[i] = CREATEOBJECT("clsFormInfo")
ENDFOR

*!* Take the memory pointer we got, and break it up into the objects we
*!* defined below.
loForms.SetPointer(lnFormsPtr)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform