Package com.sun.jna.platform.win32

# Class WTypes.BSTRByReference

java.lang.Object
com.sun.jna.PointerType
com.sun.jna.ptr.ByReference
com.sun.jna.platform.win32.WTypes.BSTRByReference

All Implemented Interfaces:
  `NativeMapped`

Enclosing interface:
  WTypes

public static class WTypes.BSTRByReference extends ByReference

## Constructor Summary

Constructors
Constructor
Description
`BSTRByReference()`
`BSTRByReference(WTypes.BSTR value)`
Store a reference to the specified `WTypes.BSTR`.

## Method Summary

Modifier and Type
Method
Description
`String`
`getString()`
Returns the String represented by the referenced `WTypes.BSTR`.
`WTypes.BSTR`
`getValue()`
Returns a copy of the `WTypes.BSTR` referenced by this object.
`void`
`setValue(WTypes.BSTR value)`
Store a reference to the specified `WTypes.BSTR`.

### Methods inherited from class com.sun.jna.ptr.ByReference

`toString`

### Methods inherited from class com.sun.jna.PointerType

`equals, fromNative, getPointer, hashCode, nativeType, setPointer, toNative`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### BSTRByReference

public BSTRByReference()

### BSTRByReference

public BSTRByReference(WTypes.BSTR value)
Store a reference to the specified `WTypes.BSTR`. This method does not maintain a reference to the object passed as an argument. The user is responsible for allocating and freeing the memory associated with this `WTypes.BSTR`.

Parameters:
  `value` - The BSTR to be referenced. Only the pointer is stored as a reference.

## Method Details

### setValue

public void setValue(WTypes.BSTR value)
Store a reference to the specified `WTypes.BSTR`. This method does not maintain a reference to the object passed as an argument. The user is responsible for allocating and freeing the memory associated with this `WTypes.BSTR`.

Parameters:
  `value` - The BSTR to be referenced. Only the pointer is stored as a reference.

### getValue

public WTypes.BSTR getValue()
Returns a copy of the `WTypes.BSTR` referenced by this object. The memory associated with the `WTypes.BSTR` may be referenced by other objects/threads which may also free the underlying native memory.

Returns:
  A new `WTypes.BSTR` object corresponding to the memory referenced by this object.

### getString

public String getString()
Returns the String represented by the referenced `WTypes.BSTR`.

Returns:
  the referenced String, if the reference is not `null`, `null` otherwise.