【发布时间】:2012-12-26 04:15:10
【问题描述】:
我有一个使用 C++ COM DLL 的 VB6 应用程序,并且 BSTR 在两者之间传递。我使用 return ::SysAllocString(L"example"); 从 C++ DLL 返回 BSTR。
我是否需要在以下示例中对这样的字符串调用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
【问题讨论】:
标签: c++ dll com memory-leaks vb6