Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More Problems with EnumForms
Message
De
01/08/2001 15:53:49
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
More Problems with EnumForms
Divers
Thread ID:
00538518
Message ID:
00538518
Vues:
53
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!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform