ASE, SQL, OLE, ADE

Reply
New Member
tg_wilk
Posts: 1
Registered: ‎05-31-2010
Message 1 of 1 (759 Views)

dwg creation date from c++

759 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:
// 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("StgOpenStorage() failed w/error %08lx"), hr);
         return DateResult;
      }
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.