Can anyone tell me what or how many things are wrong with the following code. When I run it EnumForms generates an error 'Too many arguments'. The code is :
nerror = WS_OpenPrinter(oprint.genericprinter, @lnhand, lndef) && this should open the printer
if nerror = 0
do form mymessage with 'Unable to open the selected printer. Please check.'
return 0
endif
Local loPrtInfo,lnsuccess,lnstructure
bNeeded=0
nForms=0
nSize=0
nBuffSize=2000
loPrtInfo=CreateObject('clsPrinterForms')
nSize=loPrtInfo.sizeof()
lnStructure=loPrtInfo.GetPointer(nBuffSize)
lnsuccess=WS_EnumForms(lnhand, 1 , lnStructure , nSize, @bNeeded , @nForms )
where ws_enumforms is declared as
Declare Integer EnumForms in WinSpool.Drv as WS_EnumForms ;
Integer hPrinter ;
Integer nDataLevel ;
Integer @pInfoBuffer ;
Integer nSizeOfBuffer ;
Integer @nReceivedRequired ;
Integer @nFormsReceived
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!