Marshal::FreeBSTR Method (IntPtr)
.NET Framework (current version)
Frees a BSTR using the COM SysFreeString function.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- ptr
-
Type:
System::IntPtr
The address of the BSTR to be freed.
Like Marshal::FreeCoTaskMem and Marshal::FreeHGlobal, you can use this method to deallocate memory. FreeBSTR calls the COM SysFreeString function, which frees memory allocated by any of the following unmanaged methods: SysAllocString, SysAllocStringByteLen, SysAllocStringLen, SysReAllocString, SysReAllocStringLen. You can call unmanaged methods such as these with platform invoke. For details, see Consuming Unmanaged DLL Functions.
SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Show: