您现在的位置是: 软件 > 设计在线 > 网页陶吧 > 技术平台 > HTML学习 > 正文


-Win xp中的多种网络
-试验试验试验试验
-用Freehand实现位图矢量化
-网络电话面面观

Delphi中用于读写的文件类型
2000-12-25· ·梅友松··yesky

上一页  1 2 3  下一页

  异步操作:

// set up overlapped structure fields
gOverLapped.Offset = 0;
gOverLapped.OffsetHigh = 0;
gOverLapped.hEvent = NULL;

// attempt an asynchronous read operation
bResult = ReadFile(hFile, &inBuffer, nBytesToRead, &nBytesRead,
&gOverlapped) ;

// if there was a problem, or the async. operation"s still pending ...
if (!bResult)
{
// deal with the error code
switch (dwError = GetLastError())

{
case ERROR_HANDLE_EOF:
{
// we"re reached the end of the file
// during the call to ReadFile

// code to handle that
}

case ERROR_IO_PENDING:
{
// asynchronous i/o is still in progress

// do something else for a while
GoDoSomethingElse() ;

// check on the results of the asynchronous read
bResu = GetOverlappedResult(hFile, &gOverlapped,

&nBytesRead, FALSE) ;

// if there was a problem ...
if (!bResult)
{
// deal with the error code
switch (dwError = GetLastError())
{
case ERROR_HANDLE_EOF:
{
// we"re reached the end of the file
file://during/ asynchronous operation
}

上一页  1 2 3  下一页

■ 相关内容
 Delphi中票据凭证的精确打印
 虚拟设备驱动程序两关键问题(上)
 中小企业如何实施电子商务
 在C++Builder利用NetBIOS进行编程
 开发语言之”飞短流长”
 用VB控制EXCEL生成报表
 软件工程理论的认识与运用
感谢 访问天极网,如果您觉得该文章涉及版权问题,请看这里!