1
1
// =====================================================================
2
2
//
3
- // PyStand.cpp -
3
+ // PyStand.cpp -
4
4
//
5
5
// Created by skywind on 2022/02/03
6
6
// Last Modified: 2023/03/17 20:06
@@ -82,7 +82,7 @@ std::wstring PyStand::Ansi2Unicode(const char *text)
82
82
83
83
84
84
// ---------------------------------------------------------------------
85
- // init: _args, _argv, _cwd, _pystand, _home, _runtime,
85
+ // init: _args, _argv, _cwd, _pystand, _home, _runtime,
86
86
// ---------------------------------------------------------------------
87
87
bool PyStand::CheckEnviron (const wchar_t *rtp)
88
88
{
@@ -192,11 +192,12 @@ bool PyStand::LoadPython()
192
192
193
193
// python dll must be load under "runtime"
194
194
SetCurrentDirectoryW (runtime.c_str ());
195
+ SetDllDirectoryW (runtime.c_str ());
195
196
// LoadLibrary
196
197
_hDLL = (HINSTANCE)LoadLibraryA (" python3.dll" );
197
198
if (_hDLL) {
198
199
_Py_Main = (t_Py_Main)GetProcAddress (_hDLL, " Py_Main" );
199
- }
200
+ }
200
201
201
202
// restore director
202
203
SetCurrentDirectoryW (previous.c_str ());
@@ -317,7 +318,7 @@ int PyStand::DetectScript()
317
318
// ---------------------------------------------------------------------
318
319
// init script
319
320
// ---------------------------------------------------------------------
320
- const char *init_script =
321
+ const char *init_script =
321
322
" import sys\n "
322
323
" import os\n "
323
324
" import copy\n "
@@ -379,7 +380,7 @@ const char *init_script =
379
380
// ---------------------------------------------------------------------
380
381
381
382
// ! flag: -static
382
- // ! src:
383
+ // ! src:
383
384
// ! link: stdc++, shlwapi, resource.o
384
385
// ! prebuild: windres resource.rc -o resource.o
385
386
// ! mode: win
@@ -388,7 +389,7 @@ const char *init_script =
388
389
#ifdef PYSTAND_CONSOLE
389
390
int main ()
390
391
#else
391
- int WINAPI
392
+ int WINAPI
392
393
WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR args, int show)
393
394
#endif
394
395
{
0 commit comments