Link to home
Start Free TrialLog in
Avatar of dmunoz
dmunoz

asked on

COleDocument double size

I have a COleDocument, default from AppWizard, with a call to EnableCompoundFile() on the constructor.
When I save an existing document, the size is doubled. For example, a new name document save to 83k, and if I save it again, it got 163k and stay to this size on future save.
Does someone know why, and a workaround to always save like the first time (why the littlest size) ?
I cannot change the document format (not calling EnableCompoundFile() to get a flat document for example), because I absolutely need a compatibility with older documents.
I’ve try to force m_strPathName to empty before OnSaveDocument, or delete the file, but the document already open in my application is locked and cannot be created or deleted.

Thank you for your help.
Avatar of Answers2000
Answers2000

I think this is a consequence of OLE compound files rather than anything you're doing.

I know some M$ apps generate hug files.  PC World had a utility (command line) a while a go to recover space.
Avatar of dmunoz

ASKER

Yes, I think too that it's an OLE consequence.
But I cannot switch to flat (not OLE) because of my need to
keep compatibility with old files.

COleDocument is the base for documents that support visual editing. This requires extra functionality, primarily the presentation data associated with the OLE document. Seeing as this is a data is in the form of a metafile it will take up plenty of space.
Avatar of dmunoz

ASKER

Ok Bridge, but it dont explain with the first save is smaller than the others. What I need is an explanation why this size is double, an possibly a way to work araound, and save next documents in the form of the first one.

Avatar of dmunoz

ASKER

Ok, this seem to be a hard one...
so, I double the price ;-))

Please help...

ASKER CERTIFIED SOLUTION
Avatar of Bridge
Bridge

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dmunoz

ASKER

Thank you Bridge.
Your answer perfectly fit my need.