Class NativeLibLoader
  
  
  
    Inheritance
    
    NativeLibLoader
   
  
  
  Assembly: NativeLibUtils.dll
  Syntax
  
    public static class NativeLibLoader
   
  Methods
  
  CallLibFunc<delegateT>(nint, string, ProcCaller<delegateT>)
  
  
  Declaration
  
    public static bool CallLibFunc<delegateT>(nint dllHandle, string funcName, NativeLibLoader.ProcCaller<delegateT> caller) where delegateT : class
   
  Parameters
  
  Returns
  
  Type Parameters
  
    
      
        | Name | Description | 
    
    
      
        | delegateT |  | 
    
  
  
  CallLibFunc<delegateT>(string, string, ProcCaller<delegateT>)
  
  
  Declaration
  
    public static bool CallLibFunc<delegateT>(string libName, string funcName, NativeLibLoader.ProcCaller<delegateT> caller) where delegateT : class
   
  Parameters
  
  Returns
  
  Type Parameters
  
    
      
        | Name | Description | 
    
    
      
        | delegateT |  | 
    
  
  
  CreateComObjectWithParams<T, TD>(string, string, object?[]?, out nint, out nint)
  Create COM object from export DLL function which returns pointer to object
Declaration
  
    public static T? CreateComObjectWithParams<T, TD>(string dllPath, string functionName, object?[]? args, out nint objectPointer, out nint dllPointer) where T : class where TD : Delegate
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | dllPath | Path do native DLL with export function | 
      
        | string | functionName | Calling function | 
      
        | object[] | args | Arguments to be provided in delegate method | 
      
        | nint | objectPointer | Pointer to created object, so it could be released later | 
      
        | nint | dllPointer | Pointer to DLL, so it could be free later | 
    
  
  Returns
  
  Type Parameters
  
    
      
        | Name | Description | 
    
    
      
        | T | Interface of returning object | 
      
        | TD | Delegate to method which will be called inside DLL and return pointer to object | 
    
  
  
  CreateComObject<T, TD>(string, string, out nint, out nint)
  Create COM object from export DLL function which returns pointer to object
Declaration
  
    public static T? CreateComObject<T, TD>(string dllPath, string functionName, out nint objectPointer, out nint dllPointer) where T : class where TD : Delegate
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | dllPath | Path do native DLL with export function | 
      
        | string | functionName | Calling function | 
      
        | nint | objectPointer | Pointer to created object, so it could be released later | 
      
        | nint | dllPointer | Pointer to DLL, so it could be free later | 
    
  
  Returns
  
  Type Parameters
  
    
      
        | Name | Description | 
    
    
      
        | T | Interface of returning object | 
      
        | TD | Delegate to method which will be called inside DLL and return pointer to object | 
    
  
  
  FreeDll(nint)
  
  
  Declaration
  
    public static void FreeDll(nint handle)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | nint | handle |  | 
    
  
  
  FreeDll(object?, nint, nint)
  Free DLL after it was called to create COM object
Declaration
  
    public static void FreeDll(object? comObject, nint objectPointer, nint dllPointer)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | object | comObject | Created object | 
      
        | nint | objectPointer | Pointer to created object | 
      
        | nint | dllPointer | Pointer to destroying DLL | 
    
  
  
  GetDelegate<T>(nint, string)
  
  
  Declaration
  
    public static T? GetDelegate<T>(nint dllHandle, string procName) where T : Delegate
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | nint | dllHandle |  | 
      
        | string | procName |  | 
    
  
  Returns
  
  Type Parameters
  
  
  GetLibHandle(string)
  
  
  Declaration
  
    public static nint GetLibHandle(string LibName)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | LibName |  | 
    
  
  Returns
  
  
  GetProc<delegateT>(nint, string)
  
  
  Declaration
  
    public static delegateT GetProc<delegateT>(nint dllHandle, string procName) where delegateT : class
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | nint | dllHandle |  | 
      
        | string | procName |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | delegateT |  | 
    
  
  Type Parameters
  
    
      
        | Name | Description | 
    
    
      
        | delegateT |  | 
    
  
  
  GetResStringFromDll(nint, int)
  
  
  Declaration
  
    public static string GetResStringFromDll(nint dll, int strid)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | nint | dll |  | 
      
        | int | strid |  | 
    
  
  Returns
  
  
  LoadDll(string)
  
  
  Declaration
  
    public static nint LoadDll(string libName)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | libName |  | 
    
  
  Returns
  
  
  LoadDll(string, out int)
  
  
  Declaration
  
    public static nint LoadDll(string libName, out int errorCode)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | libName |  | 
      
        | int | errorCode |  | 
    
  
  Returns
  
  
  LoadDllAsData(string)
  
  
  Declaration
  
    public static nint LoadDllAsData(string libName)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | libName |  | 
    
  
  Returns
  
  
  LoadDllAsData(string, out int)
  
  
  Declaration
  
    public static nint LoadDllAsData(string libName, out int errorCode)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | string | libName |  | 
      
        | int | errorCode |  | 
    
  
  Returns