Skip to content

Commit 4ff96dd

Browse files
committed
Merge pull request #169 from MSOpenTech/v3-winrt-bullet
Removed use of CString in WinRT code
2 parents fd381e4 + 938fa98 commit 4ff96dd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bullet/BulletMultiThreaded/Win32ThreadSupport.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ subject to the following restrictions:
2424
#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
2525

2626
#ifdef WINRT
27-
#include <atlstr.h>
2827
#define InitializeCriticalSection(arg0) InitializeCriticalSectionEx(arg0, 0, 0)
2928
#define WaitForSingleObject(arg0, arg1) WaitForSingleObjectEx(arg0, arg1, false);
3029
#define WaitForMultipleObjects(arg0, arg1, arg2, arg3) WaitForMultipleObjectsEx(arg0, arg1, arg2, arg3, false);
@@ -253,14 +252,17 @@ void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadC
253252

254253
sprintf(spuStatus.m_eventStartHandleName,"eventStart%s%d",threadConstructionInfo.m_uniqueName,i);
255254
#ifdef WINRT
256-
spuStatus.m_eventStartHandle = CreateEventEx(NULL, CString(spuStatus.m_eventStartHandleName), 0, EVENT_ALL_ACCESS);
255+
WCHAR wszBuf[MAX_PATH] = { 0 };
256+
MultiByteToWideChar(CP_UTF8, 0, spuStatus.m_eventStartHandleName, -1, wszBuf, sizeof(wszBuf));
257+
spuStatus.m_eventStartHandle = CreateEventEx(NULL, wszBuf, 0, EVENT_ALL_ACCESS);
257258
#else
258259
spuStatus.m_eventStartHandle = CreateEventA (0,false,false,spuStatus.m_eventStartHandleName);
259260
#endif
260261

261262
sprintf(spuStatus.m_eventCompletetHandleName,"eventComplete%s%d",threadConstructionInfo.m_uniqueName,i);
262263
#ifdef WINRT
263-
spuStatus.m_eventCompletetHandle = CreateEventEx(NULL, CString(spuStatus.m_eventStartHandleName), 0, EVENT_ALL_ACCESS);
264+
MultiByteToWideChar(CP_UTF8, 0, spuStatus.m_eventCompletetHandleName, -1, wszBuf, sizeof(wszBuf));
265+
spuStatus.m_eventCompletetHandle = CreateEventEx(NULL, wszBuf, 0, EVENT_ALL_ACCESS);
264266
#else
265267
spuStatus.m_eventCompletetHandle = CreateEventA (0,false,false,spuStatus.m_eventCompletetHandleName);
266268
#endif

0 commit comments

Comments
 (0)