Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to retrieve network parameters for the local computer (including Host name, Domain name, and DNS Server)
Pocket PC: custom RAPI class for operating with files and folders on mobile device
Printf-style formatted text output in VFP
How to enumerate terminal servers within the specified Windows domain
Using NetWkstaTransportEnum to obtain MAC Address of remote server
Customizing the frame of top-level form: removing the standard frame (VFP9, Vista)
Obtaining addresses for the adapters on the local computer (Win XP/2003/Vista)
Simple MAPI: how to pick an email recipient from Outlook Express address book
Testing serial ports
Winsock: initializing the service in the VFP application
Enumerating network resources
Enumerating sessions established on a server
How to obtain Content-Type value for a file type from the System Registry
Locking and unlocking file of a VFP table
Locking mouse and keyboard input for the VFP application
Shortcut Menu Class
URL: splitting into its component parts
Winsock: creating a socket that is bound to a specific service provider
Adding and deleting User Accounts
Class library providing access to the System Registry
CryptoAPI: Collection of Providers class
How to retrieve adapter information for the local computer (including MAC address)
How to retrieve configuration data for a specified printer stored in the registry (PrinterDriverData key)
How to Start a Process as Another User (NT/XP/2K)
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: 102  
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 (107.20.7.65)
13.15 min.Function: 'WTSCloseServer'
Function group: 'Terminal Services'
13.2 min.Function: 'ClosePrinter'
13.25 min.Function: 'DeleteDC'
3.09 hrs.Example: 'How to print FoxPro form -- II'
3.3 hrs.Function: 'StrFormatByteSize'
Function group: 'String'
 Function: 'SetupOpenInfFile'
3.41 hrs.Example: 'Using Common Controls: the Header Control'
 Example: 'Attaching menu to a top-level form'
 Example: 'Playing WAV sounds simultaneously'
3.63 hrs.Example: 'Finding the path to the VFP executable running'
Google
Advertise here!