共用方式為


declare_guid關鍵字

declare_guid關鍵字會指示 MIDL 將 GUID 變數發出至產生的標頭檔。

declare_guid(variable-name, guid)

參數

variable-name

指定所產生標頭檔中識別碼的變數名稱。

guid

指定將套用至所產生標頭檔中變數名稱的 GUID

範例

declare_guid(SID_Widget, 5144C348-169E-4359-A79D-5482461D9929)  

備註

Using declare_guid 相當於使用 cpp_quote 來產生宏的 EXTERN_GUID 調用。

上述範例會產生下列輸出:

cpp_quote("EXTERN_GUID(SID_Widget, 0x5144c348, 0x169e, 0x4359, 0xa7, 0x9d, 0x54, 0x82, 0x46, 0x1d, 0x99, 0x29);")

語句 declare_guid 會以方便的方式提供。 它的優點是使用與 屬性相同的 GUID 語法uuid

另請參閱

介面定義 (IDL) 檔案

cpp_quote

uuid 屬性

GUID 結構