Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
List of ODBC drivers installed (read from the [ODBC Drivers] section)
Retrieving statistics for the TCP protocol running on the local computer
Comparing file times
Enumerating Performance Counters
An alternative way of setting Form.Closable to False
Changing system colors
Using the GetLogicalDriveStrings
Using the high-resolution performance counter
Converting path to original case
List of addresses in the AutoDial mapping database
Managing Cookies
How to create a service object
WAV file recorder
Using Video Capture: enumerating installed capture drivers
Retrieving window and menu help context identifiers
Setting the last-error code for the FoxPro
Using ActiveX control for adding a menu directly to a FoxPro MDI form
Hiding mouse cursor
Who is the first in viewing the Clipboard
Enumerating forms supported by a specified printer
Searching for the specified file using the SearchPath
Terminating VFP application using the FatalAppExit
Open and close a Simple MAPI Session
Creating a file, then moving it to another destination
Winsock: initializing the service in the VFP application

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
#DEFINE WSADESCRIPTION_LEN   256
#DEFINE WSASYS_STATUS_LEN    128
DO decl
 
*| typedef struct WSAData {
*| WORD           wVersion;                              0:2
*| WORD           wHighVersion;                          2:2
*| char           szDescription[WSADESCRIPTION_LEN+1];   4:257
*| char           szSystemStatus[WSASYS_STATUS_LEN+1]; 261:129
*| unsigned short iMaxSockets;                         390:2
*| unsigned short iMaxUdpDg;                           392:2
*| char FAR *     lpVendorInfo;                        394:4
*| } WSADATA, *LPWSADATA; total bytes = 20
 
#DEFINE WSADATA_SIZE  398
*#DEFINE WS_VERSION 0x0101
#DEFINE WS_VERSION 0x0202
 
LOCAL lcBuffer, lnResult
lcBuffer = Repli(Chr(0), WSADATA_SIZE)
 
lnResult = WSAStartup (WS_VERSION, @lcBuffer)
IF lnResult = 0
    ? "The lowest version expected:", buf2word(SUBSTR(lcBuffer, 1,2))
    ? "The highest version:", buf2word(SUBSTR(lcBuffer, 3,2))
    ? "Description:", STRTRAN(SUBSTR(lcBuffer,  5,257), Chr(0),"")
    ? "System Status:", STRTRAN(SUBSTR(lcBuffer, 262,129), Chr(0),"")
 
    = "Cleanup:", WSACleanup()
ELSE
    ? "Error returned:", lnResult
ENDIF
 
FUNCTION  buf2word (lcBuffer)
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;
    Asc(SUBSTR(lcBuffer, 2,1)) * 256
 
PROCEDURE  decl
    DECLARE INTEGER WSAStartup IN ws2_32 INTEGER wVerRq, STRING @lpWSAData
    DECLARE INTEGER WSACleanup IN ws2_32
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1386 bytes  
Created: 2001-12-13 21:05:01  
Modified: 2005-12-27 10:42:41  
Visits in 7 days: 122  
Listed functions:
WSACleanup
WSAStartup
Printer friendly API declarations
Word Index links for this example:
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.22.127.92)
2.67 hrs.Function: 'WTSUnRegisterSessionNotification'
 Example: 'How to intercept window messages sent to VFP form'
9.89 hrs.Example: 'Using Multimedia Command Strings to play MIDI files'
 Example: 'Displaying dimmed window behind VFP top-level form'
17.38 hrs.Function: 'GdipFillRectangle'
 Function: 'EnumServicesStatus'
Function group: 'Service'
20.15 hrs.Example: 'How to print a bitmap file'
 Function: 'InternetCheckConnection'
Google
Advertise here!