# WinBufAlloc32Ex()

Allocates a 32-bit Windows global memory buffer for use with 32-bit scan functions, and returns a memory handle for the buffer.

Most devices return data in a 16-bit format. For these devices, create the buffer using WinBufAllocEx(). Some devices return data in higher resolution formats, or the resolution of the data can vary depending on various options used to collect the data. In these cases, determine if the buffer needs to be created using WinBufAlloc32Ex() or WinBufAlloc64Ex(). See hardware-specific information to determine the type of buffer needed. If not specifically mentioned, use WinBufAllocEx().

Some devices support acquisition of scaled data. In these cases, create the buffer with ScaledWinBufAllocEx(). See hardware-specific information to determine if the device supports scaled data.

Member of the MccService class.

## Function Prototype

VB .NET

Public Function WinBufAlloc32Ex(ByVal numPoints As Integer) As IntPtr

C# .NET

public IntPtr WinBufAlloc32Ex(int numPoints)

## Parameters

numPoints

The size of the buffer to allocate. Specifies how many data points (32-bit integers, NOT bytes) that the buffer will hold.

## Returns

- 0 if the buffer could not be allocated, or a non-zero integer handle to the buffer.

## Notes

- Unlike most other methods in the library, this method does not return an ErrorInfo object. It returns a Windows global memory handle which can then be passed to the scan methods in the library. If an error occurs, the handle will come back as 0 to indicate that the buffer was not allocated.
- When using devices that return data in a 16-bit format, the buffer can be created using WinBufAllocEx(). Some devices return data in higher resolution formats, or the resolution of the data can vary depending on various options used to collect the data. In these cases, determine if the buffer needs to be created using WinBufAlloc32Ex() or WinBufAlloc64Ex(). See hardware-specific information to determine the type of buffer needed.
- This method is preferred over the deprecated method WinBufAlloc32(). Only use WinBufAlloc32() in 32-bit legacy applications that call deprecated methods.