Re: OLE document modified

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 05/25/04


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


Relevant Pages

  • Re: Reference Counted Class Please :)
    ... And quite frankly I don't like the loss of this "is" operator functionality ... just so that objects are reference counted. ... And make sure that all added objects to the container are not referenced by ... Well that was a short lived venture into interfaces hehehehe. ...
    (alt.comp.lang.borland-delphi)
  • Re: Why not only one interface for a EJB ??
    ... I agree there is a sepration of tasks between the ... Container and the Developer, But that is hardly the reason why there ... >> As you know there are two interfaces, ... > logical and usefull seperation. ...
    (comp.lang.java.developer)
  • Re: Why not only one interface for a EJB ??
    ... I agree there is a sepration of tasks between the ... Container and the Developer, But that is hardly the reason why there ... >> As you know there are two interfaces, ... > logical and usefull seperation. ...
    (comp.lang.java.programmer)
  • Re: .NET 2.0 to be launched on Nov 8
    ... >> because generics don't require boxing. ... Maybe you need to implement interfaces to make a class a generic ... But the items you put inside that container do not have to implement an ... class method ConsoleApp.Main; ...
    (borland.public.delphi.non-technical)
  • Re: Why not only one interface for a EJB ??
    ... I agree there is a sepration of tasks between the ... Container and the Developer, But that is hardly the reason why there ... >> As you know there are two interfaces, ... > logical and usefull seperation. ...
    (comp.lang.java)