Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Retrieving list of available disk drives
Using FillMemory
Using FtpCommand
Using GetBinaryType (WinNT only) to determine the type of an executable file
Verifying a file using the Authenticode policy provider
Winsock: changing the byte ordering
Displaying Windows shell folders in TreeView control with Visual FoxPro FLL
How to display a dialog box with which the user can add a data source (DSN)
How to release and renew a lease on an IP address previously obtained through Dynamic Host Configuration Protocol (DHCP)
PocketPC: custom RAPI class for executing routines on remote Windows CE device
Simple Window Viewer
Converting a hexadecimal string to an integer
How to view system icons for the classes installed on the local machine
Obtaining OS memory performance information
Terminating all running applications from a VFP program
Using InternetGoOnline function
Winsock: retrieving the standard host name and IP address for the local machine
Creating a directory on the FTP
Drawing icons associated with the VFP main window
Enumerating network interfaces on the local computer
GDI+: reading and writing metadata in JPEG and TIFF files
GDI+: retrieving list of available image encoders and image decoders
MapiSendMail class for Visual FoxPro application
Pocket PC: base class
Using FillMemory

User rating: 8.5/10 (2 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
DECLARE INTEGER GlobalFree IN kernel32 INTEGER hMem
 
DECLARE INTEGER GlobalAlloc IN kernel32;
    INTEGER wFlags, INTEGER dwBytes
 
 
*** Part 1
* applying the FillMemory to a FoxPro string
 
DECLARE RtlFillMemory IN kernel32 AS FillMemory;
    STRING  @ Dest,;
    INTEGER   Length,;
    SHORT     nFill
 
LOCAL lcBuffer
lcBuffer = SPACE(20)
= FillMemory (@lcBuffer, Len(lcBuffer), Asc("*"))
? lcBuffer
 
 
*** Part 2
* applying the FillMemory to a memory block
 
LOCAL hMem, lnBufsize
 
* allocating a memory block
#DEFINE GMEM_FIXED  0
lnBufsize = 512
hMem = GlobalAlloc (GMEM_FIXED, lnBufsize)
 
* note that the FillMemory destination object is different
* not a reference to a string, but a memory pointer
* that is why the function has to be redeclared
 
DECLARE RtlFillMemory IN kernel32 AS FillMemory;
    INTEGER Dest,;
    INTEGER Length,;
    SHORT   nFill
 
= FillMemory (hMem, lnBufsize, 42)
 
* and releasing the memory block in the end
? GlobalFree (hMem)
 
 

User rating: 8.5/10 (2 votes)
Rate this code sample:
  • ~
981 bytes  
Created: 2001-11-30 21:38:14  
Modified: 2001-11-30 22:06:51  
Visits in 7 days: 105  
Listed functions:
FillMemory
GlobalAlloc
GlobalFree
Printer friendly API declarations
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.242.188.217)
20.28 min.Function: 'SHParseDisplayName'
20.33 min.Example: 'Using InternetSetFilePointer when resuming interrupted download from the Internet'
33.67 min.Example: 'Displaying OS Memory Status'
33.72 min.Example: 'Who is the first in viewing the Clipboard'
2.22 hrs.Function: 'GdipCreateFromHWND'
4.53 hrs.Function: 'BroadcastSystemMessage'
 Example: 'Converting long file names to the short format and vice versa'
7.2 hrs.Example: 'How to retrieve information about a cache entry (Internet Explorer)'
 Function: 'MonitorFromWindow'
12.05 hrs.Example: 'Playing WAV sounds simultaneously'
Google
Advertise here!