⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transactnamedpipe.htm

📁 Api函数详解.zip
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<style><!--
body,table {font-family:"宋体"; font-size: 9pt; line-height:11pt;}
a {text-decoration:none} a:hover {color:red;text-decoration:underline}
--></style>
<title>TransactNamedPipe</title>
</head>

<body background="../../../images/gray_weave.gif" link="#FF0000" vlink="#FF0000" alink="#FF0000" bgcolor="#FFC8C8">


<div align="center"><center>

<table border="0" width="100%" height="22" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" height="16">TransactNamedPipe</td>
  </tr>
</table>
</center></div><div align="center"><center>

<table border="1" width="100%" bordercolorlight="#808080" cellspacing="0"
bordercolordark="#FFFFFF">
  <tr>
    <td width="100%" colspan="2">VB声明</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">Declare Function TransactNamedPipe Lib &quot;kernel32&quot; 
    Alias &quot;TransactNamedPipe&quot; (ByVal hNamedPipe As Long, lpInBuffer As Any, ByVal 
    nInBufferSize As Long, lpOutBuffer As Any, ByVal nOutBufferSize As Long, lpBytesRead As 
    Long, lpOverlapped As OVERLAPPED) As Long</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">说明</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">该函数在单独一个函数中同时合并了对管道的读、写操作。客户和服务器进程都可用它</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">返回值</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">Long,如操作已结束,则返回TRUE(非零);否则返回零。在异步模式中,<a
    href="GetLastError.htm">GetLastError</a>会设置成ERROR_IO_PENDING,而且操作会继续在后台进行。可测试lpOverlapped结构中的事件对象,了解操作是否结束</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">参数表</td>
  </tr>
  <tr>
    <td width="25%">参数</td>
    <td width="75%">类型及说明</td>
  </tr>
  <tr>
    <td width="25%">hNamedPipe</td>
    <td width="75%">Long,指定一个消息类型的命名管道的句柄</td>
  </tr>
  <tr>
    <td width="25%">lpInBuffer</td>
    <td width="75%">Any,指定一个内存缓冲区,在其中包含要写入管道的数据</td>
  </tr>
  <tr>
    <td width="25%">nInBufferSize</td>
    <td width="75%">Long,指定lpInBuffer缓冲区中的字节数量</td>
  </tr>
  <tr>
    <td width="25%">lpOutBuffer</td>
    <td width="75%">Any,指定一个内存缓冲区,用于装载从管道中读入的数据</td>
  </tr>
  <tr>
    <td width="25%">nOutBufferSize</td>
    <td width="75%">Long,用于装载来自管道的数据</td>
  </tr>
  <tr>
    <td width="25%">lpBytesRead</td>
    <td width="75%">Long,指定要从管道读入的字节数量。会读入单条消息。如由于lpOutBuffer不够大,不能容下完整的消息,那么函数会返回FALSE,而且<a
    href="GetLastError.htm">GetLastError</a>会设为ERROR_MORE_DATA(消息中剩下的所有字节都会丢失)</td>
  </tr>
  <tr>
    <td width="25%">lpOverlapped</td>
    <td width="75%">OVERLAPPED,可以为NULL(变成ByVal As Long,并传递零值),或指定包含了一个事件对象的OVERLAPPED结构</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">注解</td>
  </tr>
  <tr>
    <td width="100%" colspan="2"><p align="left">如lpOverlapped设为NULL,或者句柄没有创建成FILE_FLAG_OVERLAPPED样式,那么除非读和写操作都完成,否则函数不会返回</td>
  </tr>
</table>
</center></div>


</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -