DllImportResolver 代理人

定義

提供用來透過回呼解析原生程式庫的委派。

public delegate IntPtr DllImportResolver(System::String ^ libraryName, Assembly ^ assembly, Nullable<DllImportSearchPath> searchPath);
public delegate IntPtr DllImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath);
type DllImportResolver = delegate of string * Assembly * Nullable<DllImportSearchPath> -> nativeint
Public Delegate Function DllImportResolver(libraryName As String, assembly As Assembly, searchPath As Nullable(Of DllImportSearchPath)) As IntPtr 

參數

libraryName
String

要解析的原生程式庫。

assembly
Assembly

要求解析的組件。

searchPath
Nullable<DllImportSearchPath>

PInvoke 上的 DefaultDllImportSearchPathsAttribute (如果有的話)。 否則為組件上的 DefaultDllImportSearchPathsAttribute (如果有的話)。 否則為 null

傳回值

IntPtr

nativeint

成功時為已載入原生程式庫的控制代碼,失敗時為 Zero

備註

運行時間不會針對 所 DllImportResolver傳回的句柄執行任何存留期管理。 它會保留至實作和使用程序代碼,以視需要保留連結庫載入的時間,並在需要時釋放它。

擴充方法

GetMethodInfo(Delegate)

取得表示特定委派所代表之方法的物件。

適用於