BSTR as an ole automation parameter (freeing, allocating) !!!
Posted on 2000-02-02
SDK: ASP(IIS4), BCB4
When a BSTR is passed to an ole automation function call.
Case 1 >> HRESULT _stdcall MyFunction([in] BSTR strng );
After using strng, must i free the BSTR by SysFreeString() ?
Case 2 >> HRESULT _stdcall MyFunction([int, out] BSTR * strng );
After using strng, i want to change strng value (as an out parameter),
must i free the BSTR by SysFreeString() to recreate one with
another value ?
What are the steps to initialize the strng to another value ?
Case 3 >> HRESULT _stdcall MyFunction([out, retval] BSTR * strng );
To pass an empty string, what can i do ? When the function
receives a pointer to a BSTR, can i let the pointer untouched ?
what does the value pointed by the pointer ?