Buffer.Buffer Constructor |
Language: |
Initializes a new instance of the Buffer class.
Visual Basic Public Sub New( _
ByVal lp As IntPtr, _
ByVal parent As Device _
)C# public Buffer(
IntPtr lp,
Device parent
);C++ public:
Buffer(
IntPtr lp,
Device^ parent
);JScript public function Buffer(
lp : IntPtr,
parent : Device
);
lp System.IntPtr
Pointer to the unmanaged Component Object Model (COM) interface, IDirectSoundBuffer8, which allows unmanaged COM clients to create an instance of the managed buffer class. Not supported.parent Microsoft.DirectX.DirectSound.Device
A Device object that represents the parent device to use with the buffer.
Note: If the method succeeds, check the Buffer.NotVirtualized property to determine whether a requested 3-D algorithm was available and stereo panning was substituted.Microsoft DirectSound does not initialize the contents of the buffer, and the application cannot assume that it contains silence.
If an attempt is made to create a buffer with BufferCaps.LocateInHardware set to true on a system where hardware acceleration is not available, the method fails throwing either ControlUnavailableException or InvalidCallException, depending upon the operating system.
Exceptions
AllocatedException The request failed because resources, such as a priority level, were already in use by another caller. ArgumentException An invalid parameter was passed to the called method. ArgumentNullException One or more of the parameters is null. BadFormatException The specified wave format is not supported. BufferTooSmallException The buffer size is not large enough to enable effects processing. ControlUnavailableException The buffer control (volume, pan, and so on) requested by the caller is not available. Controls must be specified when the buffer is created. InvalidCallException The method call is invalid for the current state of this object. NoAggregationException The object does not support aggregation. OutOfMemoryException DirectSound could not allocate sufficient memory to complete the call. UnsupportedException The function called is not supported at this time.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center