ADVF
The ADVF
enumeration values are flags used by a container object to specify the
requested behavior when setting up an advise sink or a caching connection with
an object. These values have different meanings, depending on the type of
connection in which they are used, and each interface uses its own subset of
the flags.
typedef enum tagADVF
{
ADVF_NODATA = 1,
ADVF_PRIMEFIRST = 4,
ADVF_ONLYONCE = 2,
ADVF_DATAONSTOP = 64,
ADVFCACHE_NOHANDLER = 8,
ADVFCACHE_FORCEBUILTIN = 16,
ADVFCACHE_ONSAVE = 32
} ADVF;
Elements
ADVF_NODATA
For data
advisory connections (IDataObject::DAdvise
For cache
connections (IOleCache::Cache), this flag requests that the cache not be
updated by changes made to the running object. Instead, the container will
update the cache by explicitly calling IOleCache::SetData. This
situation typically occurs when the iconic aspect of an object is being cached.
ADVF_NODATA
is not a valid flag for view advisory connections (IViewObject::SetAdvise
ADVF_PRIMEFIRST
Requests that
the object not wait for the data or view to change before making an initial
call to IAdviseSink::OnDataChange
ADVF_ONLYONCE
Requests that
the object make only one change notification or cache update before deleting
the connection.
ADVF_ONLYONCE
automatically deletes the advisory connection after sending one data or view
notification. The advisory sink receives only one IAdviseSink call. A
nonzero connection identifier is returned if the connection is established, so
the caller can use it to delete the connection prior to the first change
notification.
For data
change notifications, the combination of ADVF_ONLYONCE and ADVF_PRIMEFIRST
provides, in effect, an asynchronous IDataObject::GetData
When used
with caching, ADVF_ONLYONCE updates the cache one time only, on receipt of the
first OnDataChange notification. After the update is complete, the advisory
connection between the object and the cache is disconnected. The source object
for the advisory connection calls the IAdviseSink::Release method.
ADVF_DATAONSTOP
For data
advisory connections, assures accessibility to data. This flag indicates that
when the data object is closing, it should call IAdviseSink::OnDataChange
For cache
connections, this flag indicates that the object should update the cache as
part of object closure.
ADVF_DATAONSTOP
is not a valid flag for view advisory connections.
ADVFCACHE_NOHANDLER
Synonym for
ADVFCACHE_FORCEBUILTIN, which is used more often.
ADVFCACHE_FORCEBUILTIN
This value is
used by DLL object applications and object handlers that perform the drawing of
their objects. ADVFCACHE_FORCEBUILTIN instructs OLE to cache presentation data
to ensure that there is a presentation in the cache. This value is not a valid
flag for data or view advisory connections. For cache connections, this flag
caches data that requires only code shipped with OLE (or the underlying
operating system) to be present in order to produce it with IDataObject::GetData
ADVFCACHE_ONSAVE
For cache
connections, this flag updates the cached representation only when the object
containing the cache is saved. The cache is also updated when the OLE object
transitions from the running state back to the loaded state (because a
subsequent save operation would require rerunning the object). This value is
not a valid flag for data or view advisory connections.
Remarks
For a data or
view advisory connection, the container uses the ADVF constants when
setting up a connection between an IAdviseSink3F9W.KC instance and and either an IDataObject or IViewObject instance. These
connections are set up using the IDataObject::DAdvise , IDataAdviseHolder::Advise , or IViewObject::SetAdvise methods.
For a caching
connection, the constants are specified in the IOleCache::Cache method
to indicate the container s requests on how the object should update its cache.
These
constants are also used in the advf member of the STATDATA
See Also