>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--