@@ -58,15 +58,15 @@ void LoadPlugins() {
58
58
59
59
INIReader reader (iniPath.c_str ());
60
60
if (reader.ParseError () != 0 ) {
61
- std::cout << " Unable to load 'pluginLoader.ini'" << std::endl;
61
+ std::wcout << " Unable to load 'pluginLoader.ini'" << std::endl;
62
62
}
63
63
64
64
WIN32_FIND_DATA fd; // This'll store our data about the plugin we're currently loading in.
65
65
const HANDLE dllFile = FindFirstFile ((pluginsPath + L" *.dll" ).c_str (), &fd); // Get the first DLL file in our plugins dir
66
66
int dllCount = 0 ;
67
67
68
68
if (dllFile == INVALID_HANDLE_VALUE) {
69
- std::cout << " No Plugins Found..." << std::endl;
69
+ std::wcout << " No Plugins Found..." << std::endl;
70
70
return ; // Just return now, no need to bother to execute the rest of the code
71
71
}
72
72
@@ -77,7 +77,7 @@ void LoadPlugins() {
77
77
78
78
if (reader.Sections ().count (s)) {
79
79
float delayTime = reader.GetFloat (s, " delaySeconds" , 0 );
80
- std::cout << " Waiting " << delayTime << " seconds to load " << s << std::endl;
80
+ std::wcout << " Waiting " << delayTime << " seconds to load " << WidenString (s) << std::endl;
81
81
Sleep (delayTime * 1000 );
82
82
}
83
83
@@ -98,6 +98,7 @@ void LoadPlugins() {
98
98
}
99
99
100
100
int executionThread () {
101
+
101
102
AllocConsole (); // Allocate our console
102
103
103
104
std::string cmdArgs = GetCommandLineA (); // Get the command line args for our running process
@@ -121,8 +122,8 @@ int executionThread() {
121
122
SetStdHandle (STD_ERROR_HANDLE, hStdout); // stderr is going back to STDOUT
122
123
SetStdHandle (STD_INPUT_HANDLE, hStdin);
123
124
124
- std::cout << " Console allocated...\n " ;
125
- std::cout << " ==== Debug ====\n " ;
125
+ std::wcout << " Console allocated...\n " ;
126
+ std::wcout << " ==== Debug ====\n " ;
126
127
WCHAR pluginsFilePath[513 ] = { 0 };
127
128
GetModuleFileNameW (gameModule, pluginsFilePath, 512 );
128
129
@@ -132,7 +133,7 @@ int executionThread() {
132
133
133
134
// This'll hapen if we are magically unable to create the plugins dir.
134
135
if (!CreateDirectory (pPath.c_str (), nullptr ) && GetLastError () != ERROR_ALREADY_EXISTS) {
135
- std::cout << " Unable to create plugins folder..." << std::endl;
136
+ std::wcout << " Unable to create plugins folder..." << std::endl;
136
137
return FALSE ;
137
138
}
138
139
pluginsPath = pPath;
@@ -143,25 +144,6 @@ int executionThread() {
143
144
return TRUE ;
144
145
}
145
146
146
- std::wstring GetLastErrorAsString ()
147
- {
148
- // Get the error message, if any.
149
- DWORD errorMessageID = ::GetLastError ();
150
- if (errorMessageID == 0 )
151
- return std::wstring (); // No error message has been recorded
152
-
153
- LPWSTR messageBuffer = nullptr ;
154
- size_t size = FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
155
- NULL , errorMessageID, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&messageBuffer, 0 , NULL );
156
-
157
- std::wstring message (messageBuffer, size);
158
-
159
- // Free the buffer.
160
- LocalFree (messageBuffer);
161
-
162
- return message;
163
- }
164
-
165
147
#pragma region Linker Exports
166
148
167
149
#pragma comment(linker, "/export:D3D11CoreRegisterLayers=d3d11_org.D3D11CoreRegisterLayers")
0 commit comments