我有一个windows代码,我想移植到linux。在一个地方它使用_bstr_t,我想知道是否有最小的_bstr_t端口可用。我到处找了找--但没找到。我想要移植的windows代码是这样的-// Malloc and assign some value to *pmemcpy((char *)*p, (char *)str, len);
我搜索了一下,
编辑4-19-2019我发现COM返回变量和BSTR的函数调用结果。我将根据需要将它们分配给_variant_t和_bstr_t,以提供自动清理(理论上)。例如。_variant_t v = GetSomeVariant();DLL不使用CoTaskMemAlloc,但它确实使用SysAllocString生成BSTR。
overloaded function matches the argument list argument types are: (Client::SetInstObj (std::string (*)(_bstr_tbsName), std::string (*)(_bstr_t bsInstance))) object type is: std::list<Client::SetInstObj, std::allocatorCComBSTR bsName;
CComBSTR bsInst