C++ COM DLL を使用する VB6 アプリがあり、2 つの間で BSTR が渡されます。を使用して C++ DLL から BSTR を返しますreturn ::SysAllocString(L"example");
。
次の例では、そのような文字列を呼び出す必要がありSysFreeString
ますか?
Sub Main()
Dim own_str As String
Dim dll_str As String
own_str = "my own string"
dll_str = DllComObj.FunctionReturningString()
' when leaving the scope:
' no need to free own_str,
' do I need to free dll_str?
End Sub