Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More Problems with EnumForms
Message
 
 
To
01/08/2001 15:53:49
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:
00538531
Views:
24
>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.
The first time pass 0 as buffer address and buffer size
lnStructure = 0
nBuffSize = 0
lnsuccess=WS_EnumForms(lnhand, nlevel , lnStructure , nBuffSize, @bNeeded , @nForms )
According to MSDN GetLastError should return 122 - Buffer too small in this case.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform