Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Stream.CreateWaitHandle Method

Allocates a WaitHandle object.

[Visual Basic]
Protected Overridable Function CreateWaitHandle() As WaitHandle
[C#]
protected virtual WaitHandle CreateWaitHandle();
[C++]
protected: virtual WaitHandle* CreateWaitHandle();
[JScript]
protected function CreateWaitHandle() : WaitHandle;

Return Value

A reference to the allocated WaitHandle.

Remarks

For an example of creating a file and writing text to a file, see Writing Text to a File. For an example of reading text from a file, see Reading Text from a File. For an example of reading from and writing to a binary file, see Reading and Writing to a Newly Created Data File.

When called for the first time, the current method creates a WaitHandle object and returns it. On subsequent calls, CreateWaitHandle returns a reference to a unique wait handle.

Use this method if you implement the asynchronous methods and require a way of blocking in EndRead or EndWrite until the asynchronous operation is complete.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Stream Class | Stream Members | System.IO Namespace | Working with I/O | Reading Text from a File | Writing Text to a File

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.