小编snb*_*snb的帖子

如何读取.obj文件?

在Visual Studio中,编译c ++文件后会生成一个目标文件(.obj)。如何阅读和理解它?还有如何在Visual Studio 2015中对编译器进行优化后查看代码。如果已回答此问题,请重定向。

c++ windows compiler-optimization visual-studio-2015

4
推荐指数
1
解决办法
4694
查看次数

[bsoncxx ]How to append a bsoncxx::document::element TO bsoncxx::builder::basic::document?

I am getting error when try to append a element to a document.

bsoncxx::document::value _obj;  //This is Declaration of _obj in diffrent file

bsoncxx::document::element element = _obj.view()[sFieldName];
if (element.length() && element.type() == bsoncxx::type::k_document)
{
    bsoncxx::builder::basic::document bsonBuilder;
    bsonBuilder.append(element); //Getting Error
}
Run Code Online (Sandbox Code Playgroud)

Error: Error C2664 'void bsoncxx::v_noabi::builder::basic::sub_document::append_(bsoncxx::v_noabi::builder::concatenate_doc)': cannot convert argument 1 from 'bsoncxx::v_noabi::document::element' to 'bsoncxx::v_noabi::builder::concatenate_doc'

Please help me to solve this issue, how to convert a element to document or append a element to document.

Thanks

c++ mongodb bson mongo-cxx-driver

1
推荐指数
1
解决办法
2521
查看次数

BSTR 内存泄漏到 wstring

考虑以下代码,这是否存在内存泄漏?

HRESULT GetPath(wstring &outDomainPath)
{
    CComBSTR bstrDomainPath;

    AnotherGetPath(&bstrDomainPath);
    outDomainPath = bstrDomainPath.Detach();
}
Run Code Online (Sandbox Code Playgroud)

这有什么区别?(还是内存泄漏??)

HRESULT GetPath(wstring &outDomainPath)
{
    CComBSTR bstrDomainPath;

    AnotherGetPath(&bstrDomainPath);
    outDomainPath = bstrDomainPath;//removed detach
}
Run Code Online (Sandbox Code Playgroud)

c++ com memory-leaks bstr

1
推荐指数
1
解决办法
379
查看次数