Re: OLE document modified
From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 05/25/04
- Next message: Igor Tandetnik: "Re: CComGITPtr question"
- Previous message: amit: "Smart Pointer"
- In reply to: Pavol: "Re: OLE document modified"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 25 May 2004 10:44:11 -0400
The interfaces you show are implemented by the container.
IPersistStreamInit is implemented by the object this container, well,
contains. There should be some way to obtain the contained object's
interfaces from the container.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Pavol" <p.stolc@atlas.sk> wrote in message
news:eTinldiQEHA.3532@TK2MSFTNGP12.phx.gbl
> TOleContainer is defined as follows:
> type TOleContainer = class(TCustomControl, IUnknown, IOleClientSite,
> IOleInPlaceSite, IAdviseSink, IOleDocumentSite, IOleUIObjInfo);
>
> Can you be more precissely what interface of listed above to use?
> Trying to query the object for IPersistStreamInit or IPersistStream I
> get only E_NOINTERFACE error. A sample in any programming language
> would be more clearifying.
> Thanks.
>
> "Igor Tandetnik" <itandetnik@mvps.org> píše v diskusním příspěvku
> news:%23Nnh%23FaQEHA.3708@TK2MSFTNGP10.phx.gbl...
>> "Pavol" <anonymous@discussions.microsoft.com> wrote in message
>> news:83613C35-BBED-4425-82F1-CC7D94DB0006@microsoft.com
>>> type
>>> OleDoc: TOleContainer;
>>> FMemoryStream: TMemoryStream;
>>> ...
>>> OleDoc.LoadFromStream(FMemoryStream); // data from database
>>> OleDoc.DoVerb(ovPrimary); // set osUIActive state
>>> OleDoc.Modified := False;
>>>
>>> now is the document loaded and ready for editing. The problem is how
>>> to know, if this document was changed by user.
>>
>> The OLE way is to query the object for IPersistStreamInit (or
>> whatever persistent interface you initialized it with) and call
>> IsDirty method. Since I don't know what TOleContainer is (it looks
>> like a Delphi class) I can't comment on how its Modified method
>> works. Last I checked, Delphi shipped with source code for the
>> library, so you can see for yourself. --
>> With best wishes,
>> Igor Tandetnik
>>
>> "For every complex problem, there is a solution that is simple, neat,
>> and wrong." H.L. Mencken
- Next message: Igor Tandetnik: "Re: CComGITPtr question"
- Previous message: amit: "Smart Pointer"
- In reply to: Pavol: "Re: OLE document modified"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|