共用方式為


IKsPropertySet::Get 方法 (dsound.h)

Get 方法會擷取屬性集 GUID 和屬性識別碼所識別的屬性。

語法

HRESULT Get(
  [in]  REFGUID rguidPropSet,
  [in]  ULONG   ulId,
  [in]  LPVOID  pInstanceData,
  [in]  ULONG   ulInstanceLength,
  [out] LPVOID  pPropertyData,
  [in]  ULONG   ulDataLength,
  [out] PULONG  pulBytesReturned
);

參數

[in] rguidPropSet

識別屬性集的 GUID。

[in] ulId

屬性集內屬性的標識碼。

[in] pInstanceData

屬性之實例數據的指標。

[in] ulInstanceLength

InstanceData的緩衝區大小,以位元組為單位。

[out] pPropertyData

接收 屬性值之緩衝區的指標。

[in] ulDataLength

PropertyData的緩衝區大小,以位元組為單位。

[out] pulBytesReturned

接收 Get 資料大小之變數的指標 PropertyData

傳回值

如果成功,則傳回 NOERROR;否則,會傳回錯誤碼。

言論

若要擷取屬性,請配置緩衝區,Get 填滿 屬性。 若要判斷必要的緩衝區大小,請針對 PropertyData 指定 NULLDataLength指定零。 Get 方法會傳回 BytesReturned中所需的緩衝區大小。

警告

頭檔 ksproxy.hdsound.h 定義類似但不相容的 IKsPropertySet 介面版本。 需要 KS Proxy 模組的應用程式應該使用 ksproxy.h中定義的版本。 Microsoft Windows SDK 檔中的 DirectSound 參考頁面會說明 IKsPropertySet 的 DirectSound 版本。 如果應用程式必須同時包含 ksproxy.hdsound.h,則編譯程式會先掃描哪一個頭檔是編譯程式 IKsPropertySet 的定義。

要求

要求 價值
目標平臺 桌面
標頭 dsound.h (include Ksproxy.h, Dsound.h)

另請參閱

IKsPropertySet::Set