Using Win32 functions in Visual FoxPro Image Gallery
Pipe
..msdn
ConnectNamedPipe
CreateNamedPipe
CreatePipe
DisconnectNamedPipe
SetNamedPipeHandleState
Code examples:
Using named pipes for interprocess communication
CreateNamedPipe
..msdn    Add comment     W32 Constants      Translate this page
Creates an instance of a named pipe and returns a handle for subsequent pipe operations.
Code examples:
Using named pipes for interprocess communication
Declaration:
HANDLE CreateNamedPipe(
    LPCTSTR lpName,
    DWORD dwOpenMode,
    DWORD dwPipeMode,
    DWORD nMaxInstances,
    DWORD nOutBufferSize,
    DWORD nInBufferSize,
    DWORD nDefaultTimeOut,
    LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
FoxPro declaration:
DECLARE INTEGER CreateNamedPipe IN kernel32;
    STRING lpName,;
    LONG dwOpenMode,;
    LONG dwPipeMode,;
    LONG nMaxInstances,;
    LONG nOutBufferSize,;
    LONG nInBufferSize,;
    LONG nDefaultTimeOut,;
    INTEGER lpSecurityAttributes
Parameters:
lpName
[in] The unique pipe name.

dwOpenMode
[in] The pipe access mode, the overlapped mode, the write-through mode, and the security access mode of the pipe handle.

dwPipeMode
[in] The type, read, and wait modes of the pipe handle.

nMaxInstances
[in] The maximum number of instances that can be created for this pipe.

nOutBufferSize
[in] The number of bytes to reserve for the output buffer.

nInBufferSize
[in] The number of bytes to reserve for the input buffer.

nDefaultTimeOut
[in] The default time-out value, in milliseconds.

lpSecurityAttributes
[in] A pointer to a SECURITY_ATTRIBUTES structure that specifies a security descriptor for the new named pipe.
Return value:
If the function succeeds, the return value is a handle to the server end of a named pipe instance.
My comment:
LOCAL hPipe, cPipeName, nOpenMode, nPipeMode
cPipeName = "\\.\pipe\tpipe"

nOpenMode = BITOR(PIPE_ACCESS_DUPLEX,;
        FILE_FLAG_FIRST_PIPE_INSTANCE)

nPipeMode = BITOR(PIPE_TYPE_BYTE,;
        PIPE_READMODE_BYTE, PIPE_WAIT)

hPipe = CreateNamedPipe(m.cPipeName, nOpenMode, nPipeMode,;
        1, 0x1000, 0x1000,;
        NMPWAIT_USE_DEFAULT_WAIT, 0)

IF hPipe = INVALID_HANDLE_VALUE
        ? "CreateNamedPipe failed:", GetLastError()
        RETURN
ENDIF

= CloseHandle(m.hPipe)
Word Index links for the CreateNamedPipe :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2007-01-16 18:37:51
Modified: 2007-01-16 18:44:28
Visited in last 7 days: 12
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.161.73.123)
3 sec.Function: 'GdipGetPropertyItem'
7 sec.Function: 'CopyFile'
10 sec.Function: 'GdipMeasureString'
12 sec.Function: 'GdipDrawLineI'
16 sec.
Function group: 'GDI+ Matrix'
19 sec.
Function group: 'Unicode and Character Set'
23 sec.Function: 'GdipCreateStringFormat'
26 sec.Function: 'CeGetFileSize'
30 sec.Function: 'FreeLibrary'
34 sec.Function: 'DrawDibDraw'
Google
Advertise here!