首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到资源definition:BinOcaf.StoragePlugin?

找不到资源definition:BinOcaf.StoragePlugin?
EN

Stack Overflow用户
提问于 2022-03-21 09:31:21
回答 1查看 32关注 0票数 0

我有下面的代码,可以编译,但是当我运行它时,它会因为缺少资源而失败。我已经检查了级联安装程序和所有的点击和安装。我怎么才能解决这个问题?

代码语言:javascript
复制
#include <TDocStd_Application.hxx> 
#include <TDataStd_Integer.hxx>

int main()
{
    Handle(TDocStd_Application) app = new TDocStd_Application;

    Handle(TDocStd_Document) doc;
    app->NewDocument("BinOcaf", doc);
    
    if (doc.IsNull())
    {
        std::cout << "Error: cannot create an OCAF document." << std::endl;
        return 1;
    }

    // to access the main label, the transient data framework
    TDF_Label mainLab = doc->Main();

    // attach some integer value to this label
    TDataStd_Integer::Set(mainLab, 1002);
    
    // save document to file
    PCDM_StoreStatus sstatus = app->SaveAs(doc, "C:/Users/Administrator/Desktop/test.cbf");
                                                                                     
    if (sstatus != PCDM_SS_OK)
    {
        app->Close(doc);
        std::cout << "cannot write OCAF document." << std::endl;
        return 1;
    }                                                            
    // release the data of doc
    app->Close(doc);

    return 0;
}
EN

回答 1

Stack Overflow用户

发布于 2022-03-22 01:57:02

好吧,在挠头之后,我意识到了一件事。忘记定义格式了。只要将代码行添加到主函数中,就可以解决这个问题。

代码语言:javascript
复制
BinDrivers::DefineFormate(app);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71555385

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档