Class DllLibrary
Represents a base class that manages a DLL library and provides access to its exported functions.
public abstract class DllLibrary : Disposable, IDisposable
- Inheritance
-
DllLibrary
- Implements
- Inherited Members
- Extension Methods
Constructors
DllLibrary(string)
Represents a base class that manages a DLL library and provides access to its exported functions.
protected DllLibrary(string dllPath)
Parameters
dllPath
stringThe file path to the DLL.
Properties
DllPath
Gets the file path to the DLL.
public string DllPath { get; }
Property Value
DllVersion
Gets the version of the DLL by retrieving product information.
public Version DllVersion { get; }
Property Value
Handler
Gets the pointer to the loaded DLL.
protected IntPtr Handler { get; }
Property Value
Methods
DisposeNative()
Disposes native resources associated with the DLL.
protected override void DisposeNative()
GetHandler<T>(string)
Retrieves a function pointer from the DLL and casts it to the specified delegate type.
protected T GetHandler<T>(string procName)
Parameters
procName
stringThe name of the procedure to retrieve.
Returns
- T
A delegate of type
T
.
Type Parameters
T
The type of the delegate.
TryGetHandler<T>(string)
Attempts to retrieve a function pointer from the DLL as the specified delegate type. Returns null if not found.
protected T TryGetHandler<T>(string procName) where T : Delegate
Parameters
procName
stringThe name of the procedure to retrieve.
Returns
- T
A delegate of type
T
, or null if the procedure is not found.
Type Parameters
T
The type of the delegate.