I'm trying to read autocad file creation date from c++. I don't mean system file creation date, but a drawing creation date (which remains unchanged when the document is copied somewhere else). To do this, I'm using the code as below (it is just a part of the whole). It works on doc and xls files but for dwg it shows "Not a compound file". Which is not true, because windows doesn't have a problem to read the statistics (creation date included) on dwg file.
Any suggestions where to look for the problem, or how to do this for dwg ? Isn't dwg a compound document?
// Open the document as an OLE compound document.
hr = ::StgOpenStorage(filename, NULL,
STGM_READ | STGM_SHARE_EXCLUSIVE, NULL, 0, &pStorage);
if(hr == STG_E_FILENOTFOUND)
_stprintf_s(Result,MAX_PROPERTY_LENGTH,_T("File not found."));
else if(hr == STG_E_FILEALREADYEXISTS)
_stprintf_s(Result,MAX_PROPERTY_LENGTH,_T("Not a compound file."));
_stprintf_s(Result,MAX_PROPERTY_LENGTH,_T("StgOpenStorage() failed w/error %08lx"), hr);