Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Custom GDI+ class
Obtaining names and positions for shortcuts located on the Windows Desktop
GDI+: Implementing image scrolling with inertia
How to change display settings: screen resolution, screen refresh rate
Printing Image File, programmatically set print page orientation to landscape
Displaying dimmed window behind VFP top-level form
Custom FTP Class for Visual FoxPro application
Monitoring clipboard content changes (VFP9)
Displaying icons in the system tray (VFP9)
Browsing Windows Known Folders (Special Folders)
How to load a user profile
Moving shortcut to a specified position on the Windows Desktop
Enumerating devices installed on the local machine
GDI+ fun: roach-infested desktop
GDI+: Scrolling through large image using the mouse
Storing content of the Clipboard to a bitmap file
Compressing and decompressing files with Windows API Runtime Library routines
Detecting changes in connections to removable drives (VFP9)
GDI+: Creating thumbnails to preview images in a directory
How to put a horizontal text scrolling on the form (a news line, marquee)
Splash Screen for the VFP application
Writing entries to custom Event Log
Winsock: resolving an address to a host name
Vertical Label control
Using named pipes for interprocess communication

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
Before you begin:
This code sample contains definitions of two classes, NamedPipeServer and NamedPipeClient, encapsulating named pipes API functionality.

The Pipes, as well as mailslots, can be used for transferring data between processes running on same computer or on different computers.

See also:
  • Peer-to-peer LAN messenger built with Mailslot API functions
  • Using mailslots to send messages on the network
  • Using WM_COPYDATA for interprocess communication
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    5512 bytes  
    Created: 2007-01-21 20:24:52  
    Modified: 2010-05-19 22:37:13  
    Visits in 7 days: 82  
    Listed functions:
    CloseHandle
    ConnectNamedPipe
    CreateFile
    CreateNamedPipe
    DisconnectNamedPipe
    FlushFileBuffers
    GetLastError
    ReadFile
    SetNamedPipeHandleState
    WriteFile
    Printer friendly API declarations
    My comment:
    Use the following code to run pipe server.

    LOCAL oServer As NamedPipeServer
    oServer = CREATEOBJECT("NamedPipeServer", "\\.\pipe\tpipe")
    WITH oServer
            IF NOT .Listen()
                    ? .errorcode, .errormsg
            ENDIF
    ENDWITH

    Starting the pipe server switches current VFP session to a waiting state. Thus it stays frozen until receiving a request from a pipe client.

    This is a sample client code.

    LOCAL oClient As NamedPipeClient
    oClient = CREATEOBJECT("NamedPipeClient", "\\.\pipe\tpipe")

    WITH oClient
            IF NOT .SendMessage(SYS(0))
                    ? .errorcode, .errormsg
            ENDIF
    ENDWITH

    Normally a pipe server application, written in programming language other than FoxPro, would create a separate threads for listening and for processing incoming requests.

    If the pipe client code runs on a different computer than the pipe server, in the pipe client code substitute the dot "." in the pipe name with the computer name or ip address of the pipe server.

    Pipe server accepts connections on TCP port 139 (NetBIOS).

    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-2017 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.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.224.197.86)
    8 sec.Function: 'getprotobynumber'
    15 sec.Function: 'CreateEllipticRgn'
    22 sec.Function: 'GetErrorMode'
    30 sec.Function: 'InetIsOffline'
    38 sec.Function: 'GetAdaptersAddresses'
    46 sec.Function: 'MQHandleToFormatName'
    56 sec.Function: 'JetSetColumn'
    1.17 min.Function: 'closesocket'
    1.38 min.
    Function group: 'Security'
    1.65 min.
    Function group: 'Bitmap'
    Google
    Advertise here!