Documents Class API GetItemByName throws exception for Simplified Part.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to get the document pointer from Documents interface. I am calling GetItemByName API to get the pointer. However this method throws an exception and did get document pointer.
Please refer the following code snipet below:
DocumentsPtr pDocs;
pDocs = pINVApplication->GetDocuments();
CATBSTR bstrFullPath;
Identifier.ConvertToBSTR(&bstrFullPath);
FileManagerPtr pFM = pINVApplication->GetFileManager();
BSTR strlastLOD;
hr = pFM->GetLastActiveLevelOfDetailRepresentation(_bstr_t(bstrFullPath), &strlastLOD);
pFM->GetFullDocumentName(_bstr_t(bstrFullPath), strlastLOD, &bstrFullPath);
pRetDoc = pDocs->GetItemByName(_bstr_t(bstrFullPath)); //This method fails and throws exception.
This is just sudo code. Could some one please help me with this. Thanks in advance.