Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Monitor system memory / auto-adjust app
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
01166915
Message ID:
01166978
Views:
13
My pleasure. If you don't mind my asking, what technique do you use for converting your VFP app to a Windows Service?

>>Here's a diddy I wrote that some VFP developers who use a lot of images in their app might find helpful. This checks percent of total physical memory in use and does a CLEAR RESOURCES if your passed-in percentage is exceeded. Because of the extensive caching that VFP does with images, it helps your VFP app be a better neighbor.
>>
PROCEDURE CheckAdjustMemory
>>LPARAMETERS PctMax
>>LOCAL  cBuffer
>>DECLARE GlobalMemoryStatus IN Kernel32 STRING @ lpBuffer
>>cBuffer = REPLICATE(CHR(0),32)
>>=GlobalMemoryStatus(@cBuffer)
>>* Percent of memory usage; 1st byte of 2nd DWord
>>IF ASC(SUBSTR(cbuffer,5)) > PctMax
>>  CLEAR RESOURCES
>>ENDIF
>>RETURN
>
>Mark, thanks for sharing that! I've got a windows service which processes images and prints them to PDF reports, it does use alot of system resources and this should be a great help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform