Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More Problems with EnumForms
Message
 
 
To
01/08/2001 17:53:28
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:
00538641
Views:
18
>Sergey,
>Doesn't the parameter to the Prt_info_1 structure have to be a pointer to that structure so that the function can tell you how big the buffer needs to be to populate the structure with the forms that are defined for the printer? If you just pass it 0 I don't see how it could ever work. In my code, I already had the structure defined using the Struct Class.

The Prt_info_1 is know windows structure not something you define.
In the first call we pass size 0 telling function that we need to know what the size of buffer it requires. The address of the buffer is irrelevant in this case.

Now, Here is the corrected DECLARE statement. Notice that pInfoBuffer passed by value not by reference.
Declare Integer EnumFormsA in WinSpool.Drv as WS_EnumForms ;
		Integer hPrinter, ;
		Integer nDataLevel, ;
		Integer pInfoBuffer, ;
		Integer nSizeOfBuffer, ;
		Integer @nReceivedRequired, ;
		Integer @nFormsReceived
You maybe will have to increase the value in nMemorySize property of clsPrinterForms class from default size of 8192 to get it work. I used 16384 in my test.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform