Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [DGN Platform public API, C++] "DgnCore2.dll" returns "Access violation" in case gathering attachments information for V7 dgn file

$
0
0

Thank you for quick response,

In case I change LoadModelById() call to LoadRootModelById() I got this very excpetion during this call to LoadRootModelById(). I guess, ReadAndLoadDgnAttachments() is called inside LoadRootModelById().

Here is OpenFile method:

RefCountedPtr<DgnFile> DgnInfoLib::FileHelper::OpenFile(std::wstring path)
{
	DgnOpenStatus status;
	RefCountedPtr<DgnFile> file = nullptr;

	// Create document
	auto document = DgnDocument::CreateFromFileName(status, path.c_str(), nullptr, DEFDGNFILE_ID, DgnDocument::FETCH_Read, DgnDocument::FETCH_OPTION_Default);
	if (document != nullptr)
	{
		// create File and load it's header
		file = DgnFile::Create(*document, DGNFILE_OPENMODE_READONLY, *DgnInfoLib::Utils::StaticHostHelper::host);

		auto ret = file->LoadDgnFile(NULL);
	}

	return file;
}

Thank you in advance,

Artem


Viewing all articles
Browse latest Browse all 7260

Trending Articles