Earlier I had my function declaration incorrect. I have now moved on to a more difficult problem. The Code is:
Local loPrtInfo,lnsuccess,lnstructure
bNeeded=0
nForms=0
nSize=0
nlevel=1
nBuffSize=0
loPrtInfo=CreateObject('clsPrinterForms')
nBuffSize=loPrtInfo.sizeof()
lnStructure=loPrtInfo.GetPointer(nBuffSize)
lnsuccess=WS_EnumForms(lnhand, nlevel , lnStructure , nBuffSize, @bNeeded , @nForms )
if lnsuccess = 0
lmyerr=GetLastError()
lnStructure=loPrtInfo.GetPointer(bNeeded)
nBuffSize=bNeeded
*if lmyerr=122
lnsuccess=WS_EnumForms(lnhand, nlevel , lnStructure , nBuffSize,
@bNeeded , @nForms )
*endif
endif
loPrtInfo.SetPointer(lnStructure)
loPrtInfo.FreePointer(lnStructure)
When I call WS_Enumforms the first time it returns 0 and bNeeded is 7132. However GetLastError returns 0 and when WS_EnumForms is called again I am instantly back at the DESKTOP. At one point I was getting error 122 - Buffer too small- But I am not even getting that now. Thanks.
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!