Skip to content

Commit 5e9214a

Browse files
authored
Merge pull request #100 from HIllya51/master
fix loadlibrary error
2 parents b8e4364 + 321d028 commit 5e9214a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PyStand.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ bool PyStand::LoadPython()
194194
SetCurrentDirectoryW(runtime.c_str());
195195
SetDllDirectoryW(runtime.c_str());
196196

197+
auto pydll = runtime + L"\\python3.dll";
197198
// LoadLibrary
198-
_hDLL = (HINSTANCE)LoadLibraryA("python3.dll");
199+
_hDLL = (HINSTANCE)LoadLibraryW(pydll.c_str());
199200
if (_hDLL) {
200201
_Py_Main = (t_Py_Main)GetProcAddress(_hDLL, "Py_Main");
201202
}
@@ -210,7 +211,7 @@ bool PyStand::LoadPython()
210211
}
211212
else if (_Py_Main == NULL) {
212213
std::wstring msg = L"Cannot find Py_Main() in:\r\n";
213-
msg += runtime + L"\\python3.dll";
214+
msg += pydll;
214215
MessageBoxW(NULL, msg.c_str(), L"ERROR", MB_OK);
215216
return false;
216217
}

0 commit comments

Comments
 (0)