Microsoft Windows CE 3.0  

BIND_OPTS

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This structure contains parameters used during a moniker-binding operation. The BIND_OPTS2structure may be used in its place. A BIND_OPTSstructure is stored in a bind context; the same bind context is used by each component of a composite moniker during binding, allowing the same parameters to be passed to all components of a composite moniker. See IBindCtxfor more information about bind contexts.

If you're a moniker client (that is, you use a moniker to acquire an interface pointer to an object), you typically do not need to specify values for the members of this structure. The CreateBindCtxfunction creates a bind context with the bind options set to default values that are suitable for most situations. The BindMonikerfunction does the same thing when creating a bind context for use in binding a moniker. If you want to modify the values of these bind options, you can do so by passing a BIND_OPTSstructure to the IBindCtx::SetBindOptionsmethod. Moniker implementers can pass a BIND_OPTSstructure to the IBindCtx::GetBindOptionsmethod to retrieve the values of these bind options.

The BIND_OPTSstructure is defined in objidl.h.

typedef struct tagBIND_OPTS{
DWORD
cbStruct; 
DWORD
grfFlags; 
DWORD
grfMode; 
DWORD
dwTickCountDeadline; 
} BIND_OPTS, *LPBIND_OPTS;

Members

cbStruct
Size of this structure in bytes (that is, the size of the BIND_OPTSstructure).
grfFlags
Flags that control aspects of moniker binding operations. This value is any combination of the bit flags in the BIND_FLAGSenumeration. New values may be defined in the future, so moniker implementations should ignore any bits in this field that they do not understand. The CreateBindCtxfunction initializes this field to zero.
grfMode
Flags that should be used when opening the file that contains the object identified by the moniker. The values are taken from the STGMenumeration. The binding operation uses these flags in the call to IPersistFile::Loadwhen loading the file. If the object is already running, these flags are ignored by the binding operation. The CreateBindCtxfunction initializes this member to STGM_READWRITE.
dwTickCountDeadline
Clock time (in milliseconds, as returned by the GetTickCountfunction) by which the caller wants the binding operation to be completed. This member lets the caller limit the execution time of an operation when speed is of primary importance. A value of zero indicates that there is no deadline. Callers most often use this capability when calling the IMoniker::GetTimeOfLastChangemethod, though it can be usefully applied to other operations as well. The CreateBindCtxfunction initializes this member to zero.

Typical deadlines allow for a few hundred milliseconds of execution. This deadline is a recommendation, not a requirement; however, operations that exceed their deadline by a large amount may cause delays for the end user. Each moniker implementation should try to complete its operation by the deadline or fail with the error MK_E_EXCEEDEDDEADLINE.

If a binding operation exceeds its deadline because one or more objects that it needs are not running, the moniker implementation should register the objects responsible in the bind context using IBindCtx::RegisterObjectParam. The objects should be registered under the parameter names "ExceededDeadline", "ExceededDeadline1", "ExceededDeadline2", and so on. If the caller later finds the object in the Running Object Table, the caller can retry the binding operation.

The GetTickCountfunction indicates the number of milliseconds since system startup and wraps back to zero after 2^31 milliseconds. Consequently, callers should be careful not to inadvertently pass a zero value, which indicates no deadline, and moniker implementations should be aware of clock wrapping problems (see the GetTickCountfunction for more information).

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Objidl.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

BIND_FLAGS, STGM, BindMoniker, CreateBindCtx, GetTickCount, IMoniker::GetTimeOfLastChange, IPersistFile::Load, BIND_OPTS2