ExtensibleClassFactory.RegisterObjectCreationCallback 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
登錄從 Unmanaged 型別延伸的 Managed 型別的執行個體需要配置匯總的 Unmanaged 物件時會呼叫的 delegate。
public:
static void RegisterObjectCreationCallback(System::Runtime::InteropServices::ObjectCreationDelegate ^ callback);
public static void RegisterObjectCreationCallback(System.Runtime.InteropServices.ObjectCreationDelegate callback);
static member RegisterObjectCreationCallback : System.Runtime.InteropServices.ObjectCreationDelegate -> unit
Public Shared Sub RegisterObjectCreationCallback (callback As ObjectCreationDelegate)
參數
- callback
- ObjectCreationDelegate
呼叫以替代 delegate 的 CoCreateInstance。
備註
這會 delegate 設定並匯總 Unmanaged 物件,並呼叫 來取代 CoCreateInstance。 這 delegate 必須在將為其進行回呼的 static 類別初始化表達式內容中註冊。
階層中只有一個 delegate 類別應該註冊回呼。