Kaydet (Commit) eef4c133 authored tarafından Mike Kaganski's avatar Mike Kaganski

Windows: avoid dependence on UNICODE define; prefer W functions

Change-Id: I95b90128e93f0d88ed73601bcc5a7ca9279d4cf1
Reviewed-on: https://gerrit.libreoffice.org/42560Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst bb406680
......@@ -755,16 +755,6 @@ def generate(includes, libname, filename, module):
"""
f.write(sal_define)
# svx needs this (sendreportw32.cxx)
if module == 'svx' and libname == 'svx':
svx_define = """
#ifdef _WIN32
# define UNICODE
# define _UNICODE
#endif
"""
f.write(svx_define)
# Dump the headers.
f.write('\n')
for i in includes:
......
......@@ -17,23 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// Use UNICODE Windows and C API.
#define _UNICODE
#define UNICODE
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#if !defined WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <tchar.h>
#include "native_share.h"
#include "rtl/bootstrap.hxx"
......
......@@ -18,10 +18,6 @@
*/
#define UNICODE
#define _UNICODE
#include <tchar.h>
#ifdef _MSC_VER
#pragma warning(push, 1)
#pragma warning(disable:4005)
......@@ -31,7 +27,6 @@
# define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <shellapi.h>
#include <sqlext.h>
#ifdef _MSC_VER
......@@ -50,19 +45,19 @@ int displayLastError()
DWORD dwError = GetLastError();
LPVOID lpMsgBuf;
FormatMessage(
FormatMessageW(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
nullptr,
dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
reinterpret_cast<LPTSTR>(&lpMsgBuf),
reinterpret_cast<LPWSTR>(&lpMsgBuf),
0,
nullptr
);
// Display the string.
MessageBox( nullptr, static_cast<LPCTSTR>(lpMsgBuf), nullptr, MB_OK | MB_ICONERROR );
MessageBoxW( nullptr, static_cast<LPCWSTR>(lpMsgBuf), nullptr, MB_OK | MB_ICONERROR );
// Free the buffer.
LocalFree( lpMsgBuf );
......@@ -74,11 +69,11 @@ int displayLastError()
*/
BOOL registerWindowClass( HINSTANCE _hAppInstance )
{
WNDCLASSEX wcx;
WNDCLASSEXW wcx;
wcx.cbSize = sizeof(wcx); // size of structure
wcx.style = CS_HREDRAW | CS_VREDRAW; // redraw if size changes
wcx.lpfnWndProc = DefWindowProc; // points to window procedure
wcx.lpfnWndProc = DefWindowProcW; // points to window procedure
wcx.cbClsExtra = 0; // no extra class memory
wcx.cbWndExtra = 0; // no extra window memory
wcx.hInstance = _hAppInstance; // handle to instance
......@@ -89,13 +84,13 @@ BOOL registerWindowClass( HINSTANCE _hAppInstance )
wcx.lpszClassName = L"ODBCConfigMainClass"; // name of window class
wcx.hIconSm = nullptr; // small class icon
return ( !!RegisterClassEx( &wcx ) );
return ( !!RegisterClassExW( &wcx ) );
}
/// initializes the application instances
HWND initInstance( HINSTANCE _hAppInstance )
{
HWND hWindow = CreateWindow(
HWND hWindow = CreateWindowW(
L"ODBCConfigMainClass", // name of window class
L"ODBC Config Wrapper", // title-bar string
WS_OVERLAPPEDWINDOW, // top-level window
......@@ -114,7 +109,7 @@ HWND initInstance( HINSTANCE _hAppInstance )
}
// main window function
extern "C" int APIENTRY _tWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPTSTR, int )
extern "C" int APIENTRY wWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPWSTR, int )
{
if ( !registerWindowClass( _hAppInstance ) )
return FALSE;
......
......@@ -47,7 +47,6 @@
#include <salhelper/linkhelper.hxx>
#ifdef _WIN32
#define UNICODE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
......
......@@ -39,35 +39,39 @@
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
bool SofficeRuns()
{
// check for soffice by searching the communication window
return FindWindowEx( nullptr, nullptr, QUICKSTART_CLASSNAME, nullptr ) != nullptr;
return FindWindowExW( nullptr, nullptr, QUICKSTART_CLASSNAME, nullptr ) != nullptr;
}
bool launchSoffice( )
{
if ( !SofficeRuns() )
{
char filename[_MAX_PATH + 1];
wchar_t filename[_MAX_PATH + 1];
filename[_MAX_PATH] = 0;
GetModuleFileName( nullptr, filename, _MAX_PATH ); // soffice resides in the same dir
char *p = strrchr( filename, '\\' );
GetModuleFileNameW( nullptr, filename, _MAX_PATH ); // soffice resides in the same dir
wchar_t *p = wcsrchr( filename, L'\\' );
if ( !p )
return false;
strncpy( p+1, "soffice.exe", _MAX_PATH - (p+1 - filename) );
wcsncpy( p+1, L"soffice.exe", _MAX_PATH - (p+1 - filename) );
char imagename[_MAX_PATH + 1];
wchar_t imagename[_MAX_PATH + 1];
imagename[_MAX_PATH] = 0;
_snprintf(imagename, _MAX_PATH, "\"%s\" --quickstart", filename );
UINT ret = WinExec( imagename, SW_SHOW );
if ( ret < 32 )
_snwprintf(imagename, _MAX_PATH, L"\"%s\" --quickstart", filename );
STARTUPINFOW aStartupInfo;
ZeroMemory(&aStartupInfo, sizeof(aStartupInfo));
aStartupInfo.cb = sizeof(aStartupInfo);
aStartupInfo.wShowWindow = SW_SHOW;
PROCESS_INFORMATION aProcessInfo;
BOOL bSuccess = CreateProcessW(filename, imagename, nullptr, nullptr, TRUE, 0, nullptr, nullptr, &aStartupInfo, &aProcessInfo);
if ( !bSuccess )
return false;
return true;
......@@ -76,10 +80,10 @@ bool launchSoffice( )
return true;
}
int APIENTRY WinMain(HINSTANCE /*hInstance*/,
HINSTANCE /*hPrevInstance*/,
LPSTR /*lpCmdLine*/,
int /*nCmdShow*/)
int APIENTRY wWinMain(HINSTANCE /*hInstance*/,
HINSTANCE /*hPrevInstance*/,
LPWSTR /*lpCmdLine*/,
int /*nCmdShow*/)
{
// Look for --killtray argument
......@@ -87,12 +91,12 @@ int APIENTRY WinMain(HINSTANCE /*hInstance*/,
{
if ( 0 == strcmp( __argv[i], "--killtray" ) )
{
HWND hwndTray = FindWindow( QUICKSTART_CLASSNAME, nullptr );
HWND hwndTray = FindWindowW( QUICKSTART_CLASSNAME, nullptr );
if ( hwndTray )
{
UINT uMsgKillTray = RegisterWindowMessage( SHUTDOWN_QUICKSTART_MESSAGE );
SendMessage( hwndTray, uMsgKillTray, 0, 0 );
UINT uMsgKillTray = RegisterWindowMessageW( SHUTDOWN_QUICKSTART_MESSAGE );
SendMessageW( hwndTray, uMsgKillTray, 0, 0 );
}
return 0;
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#define UNICODE
#define WIN32_LEAN_AND_MEAN
#ifdef _MSC_VER
#pragma warning(push,1) // disable warnings within system headers
......@@ -27,9 +26,6 @@
#pragma warning(pop)
#endif
#define _UNICODE
#include <tchar.h>
#include <string.h>
#include <stdlib.h>
#include <systools/win32/uwinapi.h>
......@@ -250,7 +246,7 @@ DWORD WINAPI WaitForUIThread( LPVOID pParam )
#ifndef UNOPKG
HANDLE hProcess = (HANDLE)pParam;
if ( !_tgetenv( TEXT("UNOPKG") ) )
if ( !wgetenv( L"UNOPKG" ) )
WaitForInputIdle( hProcess, INFINITE );
#else
(void) pParam;
......@@ -274,10 +270,10 @@ BOOL WINAPI CtrlBreakHandler(
return TRUE;
}
int _tmain( int, _TCHAR ** )
int wmain( int, wchar_t** )
{
TCHAR szTargetFileName[MAX_PATH] = TEXT("");
STARTUPINFO aStartupInfo;
WCHAR szTargetFileName[MAX_PATH] = L"";
STARTUPINFOW aStartupInfo;
PROCESS_INFORMATION aProcessInfo;
ZeroMemory( &aStartupInfo, sizeof(aStartupInfo) );
......@@ -331,23 +327,23 @@ int _tmain( int, _TCHAR ** )
// Get image path with same name but with .exe extension
TCHAR szModuleFileName[MAX_PATH];
WCHAR szModuleFileName[MAX_PATH];
GetModuleFileName( nullptr, szModuleFileName, MAX_PATH );
_TCHAR *lpLastDot = _tcsrchr( szModuleFileName, '.' );
if ( lpLastDot && 0 == _tcsicmp( lpLastDot, _T(".COM") ) )
GetModuleFileNameW( nullptr, szModuleFileName, MAX_PATH );
WCHAR *lpLastDot = wcsrchr( szModuleFileName, '.' );
if ( lpLastDot && 0 == wcsicmp( lpLastDot, L".COM" ) )
{
size_t len = lpLastDot - szModuleFileName;
_tcsncpy( szTargetFileName, szModuleFileName, len );
_tcsncpy( szTargetFileName + len, _T(".EXE"), SAL_N_ELEMENTS(szTargetFileName) - len );
wcsncpy( szTargetFileName, szModuleFileName, len );
wcsncpy( szTargetFileName + len, L".EXE", SAL_N_ELEMENTS(szTargetFileName) - len );
}
// Create process with same command line, environment and stdio handles which
// are directed to the created pipes
BOOL fSuccess = CreateProcess(
BOOL fSuccess = CreateProcessW(
szTargetFileName,
GetCommandLine(),
GetCommandLineW(),
nullptr,
nullptr,
TRUE,
......
......@@ -35,7 +35,10 @@
// characters in the debug information
#endif
//#define UNICODE
#if !defined WINVER
#define WINVER 0x0400
#endif
#include <osl/diagnose.h>
#include <sal/log.hxx>
......@@ -54,8 +57,8 @@ using osl::ClearableMutexGuard;
namespace /* private */
{
char CLIPSRV_DLL_NAME[] = "sysdtrans.dll";
char g_szWndClsName[] = "MtaOleReqWnd###";
wchar_t CLIPSRV_DLL_NAME[] = L"sysdtrans.dll";
wchar_t g_szWndClsName[] = L"MtaOleReqWnd###";
// messages constants
......@@ -86,7 +89,7 @@ namespace /* private */
// ctor
Win32Condition()
{
m_hEvent = CreateEvent(
m_hEvent = CreateEventW(
nullptr, /* no security */
true, /* manual reset */
false, /* initial state not signaled */
......@@ -119,7 +122,7 @@ namespace /* private */
queue that's what we want, messages from the PostMessage
queue stay untouched */
MSG msg;
PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE);
PeekMessageW(&msg, nullptr, 0, 0, PM_NOREMOVE);
break;
}
......@@ -248,7 +251,7 @@ CMtaOleClipboard::CMtaOleClipboard( ) :
m_ClipboardChangedEventCount( 0 )
{
// signals that the thread was successfully setup
m_hEvtThrdReady = CreateEventA( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
m_hEvtThrdReady = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
OSL_ASSERT( nullptr != m_hEvtThrdReady );
......@@ -260,10 +263,10 @@ CMtaOleClipboard::CMtaOleClipboard( ) :
// setup the clipboard changed notifier thread
m_hClipboardChangedNotifierEvents[0] = CreateEventA( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
m_hClipboardChangedNotifierEvents[0] = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
OSL_ASSERT( nullptr != m_hClipboardChangedNotifierEvents[0] );
m_hClipboardChangedNotifierEvents[1] = CreateEventA( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
m_hClipboardChangedNotifierEvents[1] = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
OSL_ASSERT( nullptr != m_hClipboardChangedNotifierEvents[1] );
unsigned uThreadId;
......@@ -315,7 +318,7 @@ CMtaOleClipboard::~CMtaOleClipboard( )
CloseHandle( m_hEvtThrdReady );
if ( m_MtaOleReqWndClassAtom )
UnregisterClassA( g_szWndClsName, nullptr );
UnregisterClassW( g_szWndClsName, nullptr );
OSL_ENSURE( ( nullptr == m_pfncClipViewerCallback ) &&
!IsWindow( m_hwndNextClipViewer ),
......@@ -516,7 +519,7 @@ LRESULT CMtaOleClipboard::onChangeCBChain( HWND hWndRemove, HWND hWndNext )
{
// forward the message to the next one
DWORD_PTR dwpResult;
SendMessageTimeoutA(
SendMessageTimeoutW(
m_hwndNextClipViewer,
WM_CHANGECBCHAIN,
reinterpret_cast<WPARAM>(hWndRemove),
......@@ -549,7 +552,7 @@ LRESULT CMtaOleClipboard::onDrawClipboard( )
if ( IsWindow( m_hwndNextClipViewer ) )
{
DWORD_PTR dwpResult;
SendMessageTimeoutA(
SendMessageTimeoutW(
m_hwndNextClipViewer,
WM_DRAWCLIPBOARD,
static_cast< WPARAM >( 0 ),
......@@ -567,7 +570,7 @@ LRESULT CMtaOleClipboard::onDrawClipboard( )
LRESULT CMtaOleClipboard::sendMessage( UINT msg, WPARAM wParam, LPARAM lParam )
{
return ::SendMessageA( m_hwndMtaOleReqWnd, msg, wParam, lParam );
return ::SendMessageW( m_hwndMtaOleReqWnd, msg, wParam, lParam );
}
// PostMessage so we don't need to supply the HWND if we send
......@@ -575,7 +578,7 @@ LRESULT CMtaOleClipboard::sendMessage( UINT msg, WPARAM wParam, LPARAM lParam )
bool CMtaOleClipboard::postMessage( UINT msg, WPARAM wParam, LPARAM lParam )
{
BOOL const ret = PostMessageA(m_hwndMtaOleReqWnd, msg, wParam, lParam);
BOOL const ret = PostMessageW(m_hwndMtaOleReqWnd, msg, wParam, lParam);
SAL_WARN_IF(0 == ret, "dtrans", "ERROR: PostMessage() failed!");
return ret;
}
......@@ -658,7 +661,7 @@ LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARA
break;
default:
lResult = DefWindowProcA( hWnd, uMsg, wParam, lParam );
lResult = DefWindowProcW( hWnd, uMsg, wParam, lParam );
break;
}
......@@ -667,14 +670,14 @@ LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARA
void CMtaOleClipboard::createMtaOleReqWnd( )
{
WNDCLASSEXA wcex;
WNDCLASSEXW wcex;
HINSTANCE hInst = GetModuleHandleA( CLIPSRV_DLL_NAME );
HINSTANCE hInst = GetModuleHandleW( CLIPSRV_DLL_NAME );
OSL_ENSURE( nullptr != hInst, "The name of the clipboard service dll must have changed" );
ZeroMemory( &wcex, sizeof( WNDCLASSEXA ) );
ZeroMemory( &wcex, sizeof(wcex) );
wcex.cbSize = sizeof(WNDCLASSEXA);
wcex.cbSize = sizeof(wcex);
wcex.style = 0;
wcex.lpfnWndProc = static_cast< WNDPROC >( CMtaOleClipboard::mtaOleReqWndProc );
wcex.cbClsExtra = 0;
......@@ -687,10 +690,10 @@ void CMtaOleClipboard::createMtaOleReqWnd( )
wcex.lpszClassName = g_szWndClsName;
wcex.hIconSm = nullptr;
m_MtaOleReqWndClassAtom = RegisterClassExA( &wcex );
m_MtaOleReqWndClassAtom = RegisterClassExW( &wcex );
if ( 0 != m_MtaOleReqWndClassAtom )
m_hwndMtaOleReqWnd = CreateWindowA(
m_hwndMtaOleReqWnd = CreateWindowW(
g_szWndClsName, nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, hInst, nullptr );
}
......@@ -710,8 +713,8 @@ unsigned int CMtaOleClipboard::run( )
// pumping messages
MSG msg;
while( GetMessageA( &msg, nullptr, 0, 0 ) )
DispatchMessageA( &msg );
while( GetMessageW( &msg, nullptr, 0, 0 ) )
DispatchMessageW( &msg );
nRet = 0;
}
......
......@@ -32,7 +32,6 @@
#pragma warning(pop)
#endif
#include <memory>
#include <tchar.h>
using namespace ::std;
......
......@@ -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();
......
......@@ -34,7 +34,6 @@
#pragma warning (disable:4005)
#pragma warning (disable:4548)
#include <tchar.h>
#include <dispex.h>
#include <prewin.h>
......
......@@ -30,19 +30,14 @@
#include <windows.h>
#include <wininet.h>
#ifdef UNICODE
#define _UNICODE
#endif
#include <tchar.h>
// #i71984
extern "C" bool SAL_CALL WNT_hasInternetConnection()
{
DWORD dwFlags;
TCHAR szConnectionName[1024];
WCHAR szConnectionName[1024];
__try {
BOOL fIsConnected = InternetGetConnectedStateEx(
BOOL fIsConnected = InternetGetConnectedStateExW(
&dwFlags,
szConnectionName,
SAL_N_ELEMENTS(szConnectionName),
......
......@@ -39,7 +39,6 @@
extern CComModule _Module;
#include <atlcom.h>
#include <stdio.h>
#include <tchar.h>
#include <string.h>
//{{AFX_INSERT_LOCATION}}
......
......@@ -24,7 +24,6 @@
#endif
#include <windows.h>
#include <comdef.h>
#include <tchar.h>
#include <atlbase.h>
#include <atlcom.h>
#include <stdio.h>
......@@ -49,12 +48,12 @@ bool incrementMultidimensionalIndex(
const sal_Int32 * parDimensionLengths,
sal_Int32 * parMultidimensionalIndex);
int SAL_CALL _tmain( int /*argc*/, _TCHAR * /*argv[]*/ )
int SAL_CALL main( int /*argc*/, char** /*argv*/ )
{
HRESULT hr;
if( FAILED( hr=CoInitialize(NULL)))
{
_tprintf(_T("CoInitialize failed \n"));
printf("CoInitialize failed \n");
return -1;
}
......@@ -62,8 +61,8 @@ int SAL_CALL _tmain( int /*argc*/, _TCHAR * /*argv[]*/ )
if( FAILED(hr=doTest()))
{
_com_error err( hr);
const TCHAR * errMsg= err.ErrorMessage();
MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR);
const CHAR * errMsg= err.ErrorMessage();
MessageBoxA( NULL, errMsg, "Test failed", MB_ICONERROR);
}
CoUninitialize();
......
......@@ -25,7 +25,6 @@
#endif
#pragma warning(disable: 4917)
#include <comdef.h>
#include <tchar.h>
#include <atlbase.h>
#include <atlcom.h>
......@@ -36,15 +35,15 @@ int main(int /*argc*/, char** /*argv*/)
HRESULT hr;
if( FAILED( hr=CoInitialize(NULL)))
{
_tprintf(_T("CoInitialize failed \n"));
printf("CoInitialize failed \n");
return -1;
}
if( FAILED(hr=doTest()))
{
_com_error err( hr);
const TCHAR * errMsg= err.ErrorMessage();
MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR);
const CHAR * errMsg= err.ErrorMessage();
MessageBoxA( NULL, errMsg, "Test failed", MB_ICONERROR);
}
CoUninitialize();
......
......@@ -33,7 +33,6 @@
#include <stdio.h>
#include <windows.h>
#include <comdef.h>
#include <tchar.h>
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
......
......@@ -39,7 +39,6 @@
//something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>
#include <tchar.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
......
......@@ -20,29 +20,9 @@
#ifndef INCLUDED_SYSTOOLS_WIN32_QSWIN32_H
#define INCLUDED_SYSTOOLS_WIN32_QSWIN32_H
#define QUICKSTART_CLASSNAMEA "LO Listener Class"
#define QUICKSTART_WINDOWNAMEA "LO Listener Window"
#define SHUTDOWN_QUICKSTART_MESSAGEA "LO KillTray"
#define QUICKSTART_CLASSNAMEW L##QUICKSTART_CLASSNAMEA
#define QUICKSTART_WINDOWNAMEW L##QUICKSTART_WINDOWNAMEA
#define SHUTDOWN_QUICKSTART_MESSAGEW L##SHUTDOWN_QUICKSTART_MESSAGEA
#ifdef UNICODE
# define QUICKSTART_CLASSNAME QUICKSTART_CLASSNAMEW
# define QUICKSTART_WINDOWNAME QUICKSTART_WINDOWNAMEW
# define SHUTDOWN_QUICKSTART_MESSAGE SHUTDOWN_QUICKSTART_MESSAGEW
# ifndef FindWindow
# define FindWindow FindWindowW
# endif
#else
# define QUICKSTART_CLASSNAME QUICKSTART_CLASSNAMEA
# define QUICKSTART_WINDOWNAME QUICKSTART_WINDOWNAMEA
# define SHUTDOWN_QUICKSTART_MESSAGE SHUTDOWN_QUICKSTART_MESSAGEA
# ifndef FindWindow
# define FindWindow FindWindowA
# endif
#endif
#define QUICKSTART_CLASSNAME L"LO Listener Class"
#define QUICKSTART_WINDOWNAME L"LO Listener Window"
#define SHUTDOWN_QUICKSTART_MESSAGE L"LO KillTray"
#endif // INCLUDED_SYSTOOLS_WIN32_QSWIN32_H
......
......@@ -83,7 +83,6 @@ const sal_Char pBuffer_Blank[] = "";
#endif
#if defined(_WIN32) // Windows
# include <tchar.h>
# include <io.h>
# define PATH_MAX MAX_PATH
# define TEST_PLATFORM "c:/"
......
......@@ -43,13 +43,7 @@
#define RUNNING_ON_VALGRIND false
#endif