RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
WideString::Attach Method

Uses an existing BSTR for the underlying implementation.

Pascal
procedure Attach(src: WideString);
C++
__fastcall void Attach(BSTR src);

System::WideString::Attach uses the BSTR passed as an argument as the value of theSystem::WideString::WideString. While the source BSTR is attached, you can access the memory for the BSTR using either theSystem::WideString::WideString or the source BSTR

To subsequently detach from src, use the Detach method.

Warning: Do not delete the source BSTR while it is attached to theSystem::WideString::WideString. This will leave theSystem::WideString::WideString with a dangling reference.
Note: BSTR values are used with COM objects. Do not use COM objects in platform-independent applications, since COM is only available under Windows.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!