Skip navigation links
JNA API 4.5.2

Class WTypes.BSTR

  • All Implemented Interfaces:
    Direct Known Subclasses:
    WTypes.BSTR.ByReference, WTypes.LPSTR.ByReference, WTypes.LPWSTR.ByReference
    Enclosing interface:

    public static class WTypes.BSTR
    extends PointerType
    BSTR wrapper.

    From MSDN:

    A BSTR (Basic string or binary string) is a string data type that is used by COM, Automation, and Interop functions. Use the BSTR data type in all interfaces that will be accessed from script.

    The memory structure:

    Length prefix
    Length of the data array holding the string data and does not include the final two NULL characters.
    Data string
    UTF-16LE encoded bytes for the string.
    Two null characters

    The "value" of the BSTR is the pointer to the start of the Data String, the length prefix is the four bytes before that.

    The MSDN states, that a BSTR derived from a Nullpointer is treated as a string containing zero characters.

    • Constructor Detail

      • BSTR

        public BSTR()
      • BSTR

        public BSTR(Pointer pointer)
      • BSTR

        public BSTR(java.lang.String value)
    • Method Detail

      • setValue

        public void setValue(java.lang.String value)
      • getValue

        public java.lang.String getValue()
JNA API 4.5.2

Copyright © 2007-2017 Timothy Wall. All Rights Reserved.