Commit Graph
3 Commits
Author SHA1 Message Date
Claude d927f0e410 Save controls and OLE documents in Visual C++ MFC's formats
COleControl's stream (IPersistStreamInit, IPersistStorage) now has the
layout Visual C++ MFC writes: the version, extents, a stock-property
mask, the stock properties in MFC's order, and objects as a presence
byte (00, or FF for none) followed by OleSaveToStream's data. Property
bags use MFC's types (unsigned values as signed, blobs as a blob object
with MFC's class ID). A stream that fails to load leaves the control as
new.

COleClientItem writes MFC's item record: fixed fields, the item number
and the draw aspect, with flat or compound storage chosen by the
document.

The tests load a stream saved by MFC 4.2 and save it back byte for byte,
and check the property bag and document layouts.

Also adds CArchiveException::generic and CFileException::generic, the
names Visual C++ 6 used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUqfQ3sTcDCMdNCGGs
2026-11-17 14:08:51 +00:00
Claude e915cf0f60 Add the OLE dialogs and objects in rich edit text
afxodlgs.h wraps oledlg: Insert Object, Paste Special, Links, Update
Links, Change Icon, Convert and Server Busy, plus COleDocument's Links,
Convert and Change Icon commands. CRichEditDoc is now a COleDocument and
CRichEditView implements IRichEditOleCallback, so objects can be
inserted, pasted, selected, saved and loaded in the text.

The test object moves to tests/testobj.h so richtest can embed it too;
it now also gives its picture as data, which Wine's rich edit draws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUqfQ3sTcDCMdNCGGs
2026-11-07 02:00:06 +00:00
Claude cc9c6aed62 Add OLE containers: COleDocument, COleClientItem, COleStreamFile
COleDocument keeps its items and saves them either into its archive
(each object's storage copied into the file) or, with
EnableCompoundFile, into a compound file with the document's
"Contents" stream beside one storage per object. Save As moves the
objects into the new file; deleted items lose their storage.

COleClientItem creates objects new, from data or the clipboard, from
files, as links, as static pictures, or as clones; it draws them,
runs their verbs, tracks their state through its client site and
advise sink, and copies them to the clipboard or drags them.
AfxOleSetEditMenu builds the object verb menu, and COleDocument
routes the verb commands to the selected item. afxolecl.rc carries
the container messages.

tests/oletest embeds objects of a class it registers itself and covers
drawing, verbs, flat and compound files, the clipboard and cloning.
In-place activation comes with the server classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUqfQ3sTcDCMdNCGGs
2026-11-07 01:22:16 +00:00