CMonikerFile::Open

调用该成员函数打开文件或标记对象。

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

参数

  • lpszURL
    将打开的文件的URL或文件名。

  • pError
    为文件异常的指针。 在错误情况下,它将设置为原因。

  • pMoniker
    若要标记界面将使用的 IMoniker 的指针获取流。

返回值

非零,如果成功;否则为0。

备注

lpszURL 参数Macintosh不能使用。 Open 的仅 pMoniker 窗体Macintosh中。

可以为 lpszURL 参数使用URL或文件名。 例如:

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

 - 或 - 

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

要求

Header: afxole.h

请参见

参考

CMonikerFile Class

层次结构图

CMonikerFile::CMonikerFile

CAsyncMonikerFile::Open