Knowledge Base |

# BUG: IOleCache::Cache(), ADVF_DATAONSTOP, and OLE 1.0 Objects

Article ID: 111614

Article Last Modified on 3/3/2005

APPLIES TO

- Microsoft OLE 2.01
- Microsoft OLE 4.0, when used with:
  - Microsoft Windows NT 4.0
  - Microsoft Windows NT 3.51 Service Pack 5
  - Microsoft Windows 95

This article was previously published under Q111614

## SYMPTOMS

An OLE 2.0 container application document contains an embedded OLE 1.0 object. The container calls IOleCache::Cache() to control the cached presentation data for the object, and specifies ADVF_DATAONSTOP as the advise flag to Cache(). The user makes some changes to the object in the OLE 1.0 server, then attempts to update the object's presentation in the server by choosing the Update command from the File menu. Finally, the user closes the object server.
In this specific scenario, the object's presentation in the server is not updated. The object's native data, however, is correct.

## CAUSE

When the user selects Update, the presentation for the object does not go across to the cache or the container, because the container specified ADVF_DATAONSTOP as the cache option. As part of the update operation, the server internally marks the object as "not dirty". Because the object is not dirty, when the server is subsequently closed, it does not send any data to the container or the cache.

## RESOLUTION

Container applications should not specify the ADVF_DATAONSTOP flag when calling IOleCache::Cache(). Instead, they should specify ADVFCACHE_ONSAVE. When ADVFCACHE_ONSAVE is used, the OLE 1.0 object's cached presentation data will be updated correctly.

## STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

Additional query words: 2.01 3.50 4.00 kbbuglist

Keywords: kbbug KB111614