ASE, SQL, OLE, ADE
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
dwg creation date from c++
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
516 Views, 0 Replies
05-31-2010 04:29 PM
Hi,
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?
Thanks
The code:
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?
Thanks
The code:
// Open the document as an OLE compound document.
hr = ::StgOpenStorage(filename, NULL,
STGM_READ | STGM_SHARE_EXCLUSIVE, NULL, 0, &pStorage);
if(FAILED(hr)) {
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."));
else
_stprintf_s(Result,MAX_PROPERTY_LENGTH,_T("StgOpen Storage() failed w/error %08lx"), hr);
return DateResult;
}
