共用方式為


IDebugHostType2::GetHashCode 方法 (dbgmodel.h)

GetHashCode 方法會傳回類型的32位哈希碼。 除了全域比對 (,例如:與 * 相等的類型簽章,如果主機) 允許,任何符合特定類型簽章的類型實例都必須傳回相同的哈希碼。

這個方法會與類型簽章搭配使用,以便比對類型簽章與類型實例。

語法

HRESULT GetHashCode(
  ULONG *hashCode
);

參數

hashCode

類型實例的32位哈希程式代碼。 每個能夠透過非全域比對類型簽章比對另一個類型的類型,都會在這裡傳回相同的哈希碼。 偵錯主機必須保證其類型簽章方法與這個方法之間的這類同步處理。

傳回值

這個方法會傳回 HRESULT,指出成功或失敗。

備註

範例程式碼

ComPtr<IDebugHostType> spType; /* get a type (see FindTypeByName) */

ULONG typeHash;
if (SUCCEEDED(spType->GetHashCode(&typeHash)))
{
    // typeHash contains a 32-bit hash code.  The hash must be identical for 
    // every type which can match a type signature (unless the signature 
    // is a total wildcard).
}

規格需求

需求
標頭 dbgmodel.h

另請參閱

IDebugHostType2 介面