ASE, SQL, OLE, ADE

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

dwg creation date from c++

698 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;
      }

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community