![]()
An unmanaged pointer to the BSTR, or 0 if s is null.
Marshal.StringToBSTR(string) is useful for custom marshaling or when mixing managed and unmanaged code. Because this method allocates the unmanaged memory required for a string, always free the BSTR when finished by calling Marshal.FreeBSTR(IntPtr). This method provides the opposite functionality of Marshal.PtrToStringBSTR(IntPtr).