summaryrefslogtreecommitdiff
path: root/dtrans/test/win32
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-09-20 20:20:44 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-09-22 20:53:30 +0200
commiteef4c133e9649ebd690918bd7b83c2d5dc0dfcff (patch)
tree1a8d084c5b16056a15258770a05b9cd2d53a40bc /dtrans/test/win32
parentbb406680cebd6fa1e1bdb9e2de430cd9a1f44da0 (diff)
Windows: avoid dependence on UNICODE define; prefer W functions
Change-Id: I95b90128e93f0d88ed73601bcc5a7ca9279d4cf1 Reviewed-on: https://gerrit.libreoffice.org/42560 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dtrans/test/win32')
-rw-r--r--dtrans/test/win32/dnd/dndTest.cxx29
1 files changed, 14 insertions, 15 deletions
diff --git a/dtrans/test/win32/dnd/dndTest.cxx b/dtrans/test/win32/dnd/dndTest.cxx
index 16d16f74f891..b9f1d841e1c5 100644
--- a/dtrans/test/win32/dnd/dndTest.cxx
+++ b/dtrans/test/win32/dnd/dndTest.cxx
@@ -22,7 +22,6 @@
#endif
#include <windows.h>
#include <comdef.h>
-#include <tchar.h>
#include <atlbase.h>
CComModule _Module;
#include <atlcom.h>
@@ -59,11 +58,11 @@ int main( int argc, char *argv[ ], char *envp[ ] )
HRESULT hr;
if( FAILED( hr=CoInitialize(NULL )))
{
- _tprintf(_T("CoInitialize failed \n"));
+ printf("CoInitialize failed \n");
return -1;
}
- _Module.Init( ObjectMap, GetModuleHandle( NULL));
+ _Module.Init( ObjectMap, GetModuleHandleA( NULL));
if( FAILED(hr=doTest()))
{
@@ -82,7 +81,7 @@ HRESULT doTest()
// create the MTA thread that is used to realize MTA calls to the services
// We create the thread and wait until the thread has created its message queue
- HANDLE evt= CreateEvent(NULL, FALSE, FALSE, NULL);
+ HANDLE evt= CreateEventA(NULL, FALSE, FALSE, NULL);
DWORD threadIdMTA=0;
HANDLE hMTAThread= CreateThread( NULL, 0, MTAFunc, &evt, 0, &threadIdMTA);
WaitForSingleObject( evt, INFINITE);
@@ -90,27 +89,27 @@ HRESULT doTest()
HRESULT hr= S_OK;
RECT pos1={0,0,300,200};
- AWindow win(_T("DnD starting in Ole STA"), threadIdMTA, pos1);
+ AWindow win("DnD starting in Ole STA", threadIdMTA, pos1);
RECT pos2={ 0, 205, 300, 405};
- AWindow win2( _T("DnD starting in MTA"), threadIdMTA, pos2, true);
+ AWindow win2("DnD starting in MTA", threadIdMTA, pos2, true);
// win3 and win4 call initialize from an MTA but they are created in an STA
RECT pos3={300,0,600,200};
- AWindow win3(_T("DnD starting in OLE STA"), threadIdMTA, pos3, false, true);
+ AWindow win3("DnD starting in OLE STA", threadIdMTA, pos3, false, true);
RECT pos4={ 300, 205, 600, 405};
- AWindow win24( _T("DnD starting in Ole MTA"), threadIdMTA, pos4, true, true);
+ AWindow win24("DnD starting in Ole MTA", threadIdMTA, pos4, true, true);
MSG msg;
- while( GetMessage(&msg, (HWND)NULL, 0, 0) )
+ while( GetMessageA(&msg, (HWND)NULL, 0, 0) )
{
TranslateMessage( &msg);
- DispatchMessage( &msg);
+ DispatchMessageA( &msg);
}
// Shut down the MTA thread
- PostThreadMessage( threadIdMTA, WM_QUIT, 0, 0);
+ PostThreadMessageA( threadIdMTA, WM_QUIT, 0, 0);
WaitForSingleObject(hMTAThread, INFINITE);
CloseHandle(hMTAThread);
@@ -124,13 +123,13 @@ DWORD WINAPI MTAFunc( void* threadData)
ATLASSERT( FAILED(hr) );
MSG msg;
// force the creation of a message queue
- PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
+ PeekMessageA(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
SetEvent( *(HANDLE*)threadData );
RECT pos={0, 406, 300, 605};
- AWindow win(_T("DnD, full MTA"), GetCurrentThreadId(), pos, false, true);
+ AWindow win("DnD, full MTA", GetCurrentThreadId(), pos, false, true);
- while( GetMessage(&msg, (HWND)NULL, 0, 0) )
+ while( GetMessageA(&msg, (HWND)NULL, 0, 0) )
{
switch( msg.message)
{
@@ -168,7 +167,7 @@ DWORD WINAPI MTAFunc( void* threadData)
} // end switch
TranslateMessage( &msg);
- DispatchMessage( &msg);
+ DispatchMessageA( &msg);
}
CoUninitialize();