add <modpath>/libraries/windows to the dll search path before loading Tolk. This enables nvdaControllerClient64.dll to be loaded in place.
parent
1c61580d6b
commit
32db14b329
|
@ -0,0 +1,8 @@
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
public static class NativeMethods
|
||||||
|
{
|
||||||
|
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
||||||
|
public static extern bool SetDllDirectory(string lpPathName);
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using DavyKager;
|
using DavyKager;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace stardew_access.ScreenReader
|
namespace stardew_access.ScreenReader
|
||||||
{
|
{
|
||||||
|
@ -15,6 +16,13 @@ namespace stardew_access.ScreenReader
|
||||||
|
|
||||||
public void InitializeScreenReader()
|
public void InitializeScreenReader()
|
||||||
{
|
{
|
||||||
|
if (MainClass.ModHelper is not null)
|
||||||
|
{
|
||||||
|
// Set the path to load Tolk.dll from
|
||||||
|
string dllDirectory = Path.Combine(MainClass.ModHelper.DirectoryPath, "libraries", "windows");;
|
||||||
|
// Call SetDllDirectory to change the DLL search path
|
||||||
|
NativeMethods.SetDllDirectory(dllDirectory);
|
||||||
|
}
|
||||||
MainClass.InfoLog("Initializing Tolk...");
|
MainClass.InfoLog("Initializing Tolk...");
|
||||||
Tolk.TrySAPI(true);
|
Tolk.TrySAPI(true);
|
||||||
Tolk.Load();
|
Tolk.Load();
|
||||||
|
|
Loading…
Reference in New Issue