DECLARE INTEGER CreatePipe IN kernel32; INTEGER @hReadPipe, INTEGER @hWritePipe,; STRING @lpPipeAttributes, INTEGER nSize LOCAL lcSecurity, hGiveout, hWrite STORE 0 TO hGiveout, hWrite lcSecurity = Chr(12) + Repli(Chr(0),7) + Chr(1) + Repli(Chr(0),3) IF CreatePipe(@hGiveout, @hWrite, @lcSecurity, 16384) = 0 * unable to create a pipe RETURN .F. ENDIFTake a look, there are many other examples of how to call Win32 functions in Visual FoxPro here:
PROCEDURE StartService ThisForm.StopService LOCAL cPipeName, cFullName, nOpenMode, nPipeMode, nBlockMode cPipeName = LOWER(ALLTRIM(ThisForm.txtName.Value)) cFullName = '\\.\pipe\' + m.cPipeName nOpenMode = ThisForm.ogOpenMode.GetOpenMode() nPipeMode = Iif(ThisForm.ogPipeMode.Value=1,; BitOr(PIPE_TYPE_MESSAGE,PIPE_READMODE_MESSAGE),; BitOr(PIPE_TYPE_BYTE,PIPE_READMODE_BYTE)) nBlockMode = Iif(ThisForm.ogBlockMode.Value=1,; PIPE_NOWAIT, PIPE_WAIT) ThisForm.txtHandle.Value = CreateNamedPipe(m.cFullName, nOpenMode,; BitOr(nPipeMode, nBlockMode), PIPE_UNLIMITED_INSTANCES,; 1024, 1024, 20000, 0) IF ThisForm.txtHandle.Value = INVALID_HANDLE_VALUE = MessageB('Could not create named pipe ' + Chr(13) +; m.cFullName, 48, ' Error') ELSE WITH ThisForm .txtName.ReadOnly=.T. STORE .F. TO .ogOpenMode.Enabled,; .ogPipeMode.Enabled, .ogBlockMode.Enabled .cmdInfo.Enabled=.T. .cmdStart.Enabled=.F. .cmdStop.Enabled=.T. .Caption = 'Named pipe server running...' .tm.Interval = 1000 ENDWITH ENDIF