Hi all,
Hope this is right place to ask my question.
I'm working with DGN Platform public API to develop tiny DLL, which can be used to get basic meta info about dgn file: version (V7,V8) and references (attachments list).
DLL works perfectly fine with V8 dgn file. Nevertheless, for V7 dgn file during execution method Bentley::DGNPlatform::DgnModelRef::LoadRootModelById() I got an exception:
"Exception thrown at 0x00007FFA85AFD023 (DgnCore2.dll) in Test.exe: 0xC0000005: Access violation writing location 0x00000000000000A0."
Unfortunately, I have no debugging symbols for DgnCore2.dll, so I can't dig deeper and understand the root cause.
Here is code snippet:
std::vector<std::wstring> references; for each (DgnFileBase::ModelIndexCollection::Entry const& entry in file->GetModelIndexCollection()) { Bentley::StatusInt status_load = 0; DgnModelPtr model = file->LoadModelById(entry.GetModelId()); bool loadCaches = false; bool loadUndisplayed = false; bool loadRasterRefs = false; auto type = model->GetModelInfo().GetModelType(); DgnModelRef::DgnAttachmentLoadOptions refLoadOption(loadCaches, loadUndisplayed, loadRasterRefs); model->ReadAndLoadDgnAttachments(refLoadOption); if (status_load == 0) { auto attachs = model->GetDgnAttachmentsP(); if (attachs) { for (int i = 0; i < attachs->size(); i++) { auto attach = attachs->at(i); std::wstring attachFullPath(attach->GetAttachFullFileSpec().c_str()); references.push_back(attachFullPath); } } } }
And here is test file which I created in MicroStation V8i ("Save As" option - > select V7 format in the opened window -> click Save):
https://drive.google.com/open?id=0B6Zfx2wnTZEOYnRra2hFamQxMjA