Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More Problems with EnumForms
Message
 
To
01/08/2001 21:28:21
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:
00538772
Views:
15
>Again thanks. I will try it in the morning when I get to work. General question - how is one to know that the Prt_info_1 stru does not need to be defined? Where does this info reside?

Calvin,

Information like this can be found in the Platform SDK.

To generalize structures, they are an area of contiguous memory. Not having the ability to create structures in VFP, we use strings. Structures can and do contain pointers to other areas of memory. What resides in the other areas is totally dependent on the structure. The structure can have point a to an integer, a string, or even another structure. It does not, however, have to contain a pointer. IOW, it can be fully self-contained. Here are two examples, one for each. First, a simple structure containing no pointers.
typedef struct _SYSTEMTIME { 
    WORD wYear; 
    WORD wMonth; 
    WORD wDayOfWeek; 
    WORD wDay; 
    WORD wHour; 
    WORD wMinute; 
    WORD wSecond; 
    WORD wMilliseconds; 
} SYSTEMTIME, *PSYSTEMTIME;
The SYSTEMTIME structure is made up, as you can see, of 8 2 byte integers. To simulate this in VFP, we'd pass a string consisting of 16 bytes. In order to retrieve the values, we have to parse the string and convert the values (stored in low-byte/high byte form). So in order, to convert, say the wMonth member, we'd pass SUBSTR(lcsystime, 3, 2) to the conversion routine, where the lcsystime variable represents the string we've used.

The PRINTER_INFO_1 structure that's been mentioned is defined as:
typedef struct _PRINTER_INFO_1 { 
  DWORD  Flags; 
  LPTSTR pDescription; 
  LPTSTR pName; 
  LPTSTR pComment; 
} PRINTER_INFO_1, *PPRINTER_INFO_1;
This sturcture is made up of a 4 byte integer, and three pointers to strings. Win32 uses 4 byte integers as pointers, so this structure is also 16 bytes. The problem here is retrieving the information that the pointers point to.

I'd suggest that if you're interested, you go to Wiki and read the text of Ed Rauh's two WNL lectures titled "Pointers on Pointers" for further information.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform