共用方式為


IFileDataRetriever2::GetAbsoluteSourceFilePath

取得檔案的絕對路徑。

HRESULT GetAbsoluteSourceFilePath(
  LPWSTR pszAbsoluteSourceFilePath,
  ULONG *pcchAbsoluteSourceFilePathLength);

參數

  • pszAbsoluteSourceFilePath
    [in, out, size_is(*pcchAbsoluteSourceFilePathLength), unique] 傳回檔案的絕對路徑。
  • pcchAbsoluteSourceFilePathLength
    [in, out] 指定 pszAbsoluteSourceFilePath 中的字元數目。如果 pszAbsoluteSourceFilePath 太小,就傳回擷取此目錄所需的字元數目,否則就傳回寫入的字元數目。

傳回值

  • S_OK

  • 如果絕對檔案路徑超過 MAX_PATH,則為 CO_E_PATHTOOLONG。

  • E_POINTER

  • 當 pszAbsoluteSourceFilePath 太小時,則為 HRESULT_FROM_WIN32(ERROR_MORE_DATA)。在這種情況下,所需的字元數目是在 pcchAbsoluteSourceFilePathLength 中傳回。

請參閱

參考

IFileDataRetriever2 介面