共用方式為


CMonikerFile Class

Represents a stream of data (IStream) named by an IMoniker.

class CMonikerFile : public COleStreamFile

Members

Public Constructors

Name

Description

CMonikerFile::CMonikerFile

Constructs a CMonikerFile object.

Public Methods

Name

Description

CMonikerFile::Close

Detaches and releases the stream and releases the moniker.

CMonikerFile::Detach

Detaches the IMoniker from this CMonikerFile object.

CMonikerFile::GetMoniker

Returns the current moniker.

CMonikerFile::Open

Opens the specified file to obtain a stream.

Protected Methods

Name

Description

CMonikerFile::CreateBindContext

Obtains the bind context or creates a default initialized bind context.

Remarks

A moniker contains information much like a pathname to a file. If you have a pointer to a moniker object's IMoniker interface, you can get access to the identified file without having any other specific information about where the file is actually located.

Derived from COleStreamFile, CMonikerFile takes a moniker or a string representation it can make into a moniker and binds to the stream for which the moniker is a name. You can then read and write to that stream. The real purpose of CMonikerFile is to provide simple access to IStreams named by IMonikers so that you do not have to bind to a stream yourself, yet have CFile functionality to the stream.

CMonikerFile cannot be used to bind to anything other than a stream. If you want to bind to storage or an object, you must use the IMoniker interface directly.

For more information on streams and monikers, see COleStreamFile in the MFC Reference and IStream and IMoniker in the Windows SDK.

Inheritance Hierarchy

CObject

CFile

COleStreamFile

CMonikerFile

Requirements

Header: afxole.h

See Also

Reference

COleStreamFile Class

Hierarchy Chart

CAsyncMonikerFile Class