Partilhar via


CMonikerFile::Open

Call this member function to open a file or moniker object.

virtual BOOL Open(
   LPCTSTR lpszURL,
   CFileException* pError = NULL 
);
virtual BOOL Open(
   IMoniker* pMoniker,
   CFileException* pError = NULL 
);

Parameters

  • lpszURL
    A URL or filename of the file to be opened.

  • pError
    A pointer to a file exception. In the event of an error, it will be set to the cause.

  • pMoniker
    A pointer to the moniker interface IMoniker to be used to obtain a stream.

Return Value

Nonzero if successful; otherwise 0.

Remarks

The lpszURL parameter cannot be used on a Macintosh. Only the pMoniker form of Open can be used on a Macintosh.

You can use a URL or a filename for the lpszURL parameter. For example:

CMyMoniker* pMyMoniker = new CMyMoniker();
pMyMoniker->Open(_T("https://www.microsoft.com"));

 – or – 

CMyMoniker* pMyMoniker = new CMyMoniker();
pMyMoniker->Open(_T("file:c:\\mydata.dat"));

Requirements

Header: afxole.h

See Also

Reference

CMonikerFile Class

Hierarchy Chart

CMonikerFile::CMonikerFile

CAsyncMonikerFile::Open

Other Resources

CMonikerFile Members