summaryrefslogtreecommitdiff
path: root/extensions
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 /extensions
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 'extensions')
-rw-r--r--extensions/source/activex/so_activex.cxx88
-rw-r--r--extensions/source/ole/wincrap.hxx1
-rw-r--r--extensions/source/update/check/onlinecheck.cxx9
-rw-r--r--extensions/test/ole/AxTestComponents/StdAfx.h1
-rw-r--r--extensions/test/ole/OleConverterVar1/convTest.cxx129
-rw-r--r--extensions/test/ole/cppToUno/testcppuno.cxx9
-rw-r--r--extensions/test/ole/cpptest/cpptest.cxx7
-rw-r--r--extensions/test/ole/unoTocomCalls/Test/StdAfx.h1
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h1
9 files changed, 130 insertions, 116 deletions
diff --git a/extensions/source/activex/so_activex.cxx b/extensions/source/activex/so_activex.cxx
index 0f523c1e8b16..b9858d01ec6b 100644
--- a/extensions/source/activex/so_activex.cxx
+++ b/extensions/source/activex/so_activex.cxx
@@ -64,8 +64,8 @@ END_OBJECT_MAP()
#pragma clang diagnostic pop
#endif
-#define X64_LIB_NAME "so_activex_x64.dll"
-#define X32_LIB_NAME "so_activex.dll"
+#define X64_LIB_NAME L"so_activex_x64.dll"
+#define X32_LIB_NAME L"so_activex.dll"
// to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY
// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems.
@@ -196,7 +196,7 @@ const char* const aLocalPrefix = "Software\\Classes\\";
BOOL createKey( HKEY hkey,
const char* aKeyToCreate,
- REGSAM nKeyAccess,
+ REGSAM nKeyAccess,
const char* aValue = nullptr,
const char* aChildName = nullptr,
const char* aChildValue = nullptr )
@@ -220,8 +220,34 @@ BOOL createKey( HKEY hkey,
}
+BOOL createKey( HKEY hkey,
+ const wchar_t* aKeyToCreate,
+ REGSAM nKeyAccess,
+ const wchar_t* aValue = nullptr,
+ const wchar_t* aChildName = nullptr,
+ const wchar_t* aChildValue = nullptr )
+{
+ HKEY hkey1;
+
+ return ( ERROR_SUCCESS == RegCreateKeyExW( hkey, aKeyToCreate, 0, nullptr, REG_OPTION_NON_VOLATILE, nKeyAccess, nullptr, &hkey1 , nullptr )
+ && ( !aValue || ERROR_SUCCESS == RegSetValueExW( hkey1,
+ L"",
+ 0,
+ REG_SZ,
+ reinterpret_cast<const BYTE*>(aValue),
+ sal::static_int_cast<DWORD>(wcslen(aValue)*sizeof(wchar_t))))
+ && ( !aChildName || ERROR_SUCCESS == RegSetValueExW( hkey1,
+ aChildName,
+ 0,
+ REG_SZ,
+ reinterpret_cast<const BYTE*>(aChildValue),
+ sal::static_int_cast<DWORD>(wcslen(aChildValue)*sizeof(wchar_t))))
+ && ERROR_SUCCESS == RegCloseKey( hkey1 ) );
+
+}
+
STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit );
-STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess, const char* pProgramPath, const char* pLibName )
+HRESULT DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess, const wchar_t* pProgramPath, const wchar_t* pLibName )
{
BOOL aResult = FALSE;
@@ -230,7 +256,7 @@ STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAc
HKEY hkey2 = nullptr;
HKEY hkey3 = nullptr;
HKEY hkey4 = nullptr;
- char aSubKey[513];
+ char aSubKey[513];
int ind;
const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix;
@@ -241,13 +267,13 @@ STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAc
if ( bForAllUsers )
DllUnregisterServerNative( nMode, false, false );
- if ( pProgramPath && strlen( pProgramPath ) < 1024 )
+ if ( pProgramPath && wcslen( pProgramPath ) < 1024 )
{
- char pActiveXPath[1124];
- char pActiveXPath101[1124];
+ wchar_t pActiveXPath[1124];
+ wchar_t pActiveXPath101[1124];
- sprintf( pActiveXPath, "%s\\%s", pProgramPath, pLibName );
- sprintf( pActiveXPath101, "%s\\%s, 101", pProgramPath, pLibName );
+ swprintf( pActiveXPath, L"%s\\%s", pProgramPath, pLibName );
+ swprintf( pActiveXPath101, L"%s\\%s, 101", pProgramPath, pLibName );
{
wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID );
@@ -256,12 +282,12 @@ STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAc
&& ERROR_SUCCESS == RegSetValueExA( hkey, "", 0, REG_SZ, reinterpret_cast<const BYTE*>("SOActiveX Class"), 17 )
&& createKey( hkey, "Control", nKeyAccess )
&& createKey( hkey, "EnableFullPage", nKeyAccess )
- && createKey( hkey, "InprocServer32", nKeyAccess, pActiveXPath, "ThreadingModel", "Apartment" )
+ && createKey( hkey, L"InprocServer32", nKeyAccess, pActiveXPath, L"ThreadingModel", L"Apartment" )
&& createKey( hkey, "MiscStatus", nKeyAccess, "0" )
&& createKey( hkey, "MiscStatus\\1", nKeyAccess, "131473" )
&& createKey( hkey, "ProgID", nKeyAccess, "so_activex.SOActiveX.1" )
&& createKey( hkey, "Programmable", nKeyAccess )
- && createKey( hkey, "ToolboxBitmap32", nKeyAccess, pActiveXPath101 )
+ && createKey( hkey, L"ToolboxBitmap32", nKeyAccess, pActiveXPath101 )
&& createKey( hkey, "TypeLib", nKeyAccess, aTypeLib )
&& createKey( hkey, "Version", nKeyAccess, "1.0" )
&& createKey( hkey, "VersionIndependentProgID", nKeyAccess, "so_activex.SOActiveX" )
@@ -281,10 +307,10 @@ STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAc
&& createKey( hkey2, "1.0", nKeyAccess, "wrap_activex 1.0 Type Library" )
&& ERROR_SUCCESS == RegCreateKeyExA( hkey2, "1.0", 0, nullptr, REG_OPTION_NON_VOLATILE, nKeyAccess, nullptr, &hkey3 , nullptr )
&& ERROR_SUCCESS == RegCreateKeyExA( hkey3, "0", 0, nullptr, REG_OPTION_NON_VOLATILE, nKeyAccess, nullptr, &hkey4 , nullptr )
- && createKey( hkey4, "win32", nKeyAccess, pActiveXPath )
+ && createKey( hkey4, L"win32", nKeyAccess, pActiveXPath )
&& ERROR_SUCCESS == RegCloseKey( hkey4 )
&& createKey( hkey3, "FLAGS", nKeyAccess, "0" )
- && createKey( hkey3, "HELPDIR", nKeyAccess, pProgramPath )
+ && createKey( hkey3, L"HELPDIR", nKeyAccess, pProgramPath )
&& ERROR_SUCCESS == RegCloseKey( hkey3 )
&& ERROR_SUCCESS == RegCloseKey( hkey2 )
&& ERROR_SUCCESS == RegCloseKey( hkey1 )
@@ -363,7 +389,7 @@ STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAc
return HRESULT(aResult);
}
-STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit, const char* pProgramPath )
+STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit, const wchar_t* pProgramPath )
{
HRESULT hr = S_OK;
if ( bFor64Bit )
@@ -418,10 +444,10 @@ STDAPI DllUnregisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKey
fErr = TRUE;
else
{
- if ( ERROR_SUCCESS != RegDeleteValue( hkey, "CLSID" ) )
+ if ( ERROR_SUCCESS != RegDeleteValueA( hkey, "CLSID" ) )
fErr = TRUE;
- if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, nullptr, nullptr, nullptr,
+ if ( ERROR_SUCCESS != RegQueryInfoKeyA( hkey, nullptr, nullptr, nullptr,
&nSubKeys, nullptr, nullptr,
&nValues, nullptr, nullptr, nullptr, nullptr ) )
{
@@ -443,7 +469,7 @@ STDAPI DllUnregisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKey
fErr = TRUE;
else
{
- if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, nullptr, nullptr, nullptr,
+ if ( ERROR_SUCCESS != RegQueryInfoKeyA( hkey, nullptr, nullptr, nullptr,
&nSubKeys, nullptr, nullptr,
&nValues, nullptr, nullptr, nullptr, nullptr ) )
{
@@ -637,15 +663,15 @@ STDAPI DllUnregisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAcc
fErr = TRUE;
else
{
- if ( ERROR_SUCCESS != RegDeleteValue( hkey, "Extension" ) )
+ if ( ERROR_SUCCESS != RegDeleteValueA( hkey, "Extension" ) )
fErr = TRUE;
- if ( ERROR_SUCCESS != RegDeleteValue( hkey, "CLSID" ) )
+ if ( ERROR_SUCCESS != RegDeleteValueA( hkey, "CLSID" ) )
fErr = TRUE;
- if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, nullptr, nullptr, nullptr,
- &nSubKeys, nullptr, nullptr,
- &nValues, nullptr, nullptr, nullptr, nullptr ) )
+ if ( ERROR_SUCCESS != RegQueryInfoKeyA( hkey, nullptr, nullptr, nullptr,
+ &nSubKeys, nullptr, nullptr,
+ &nValues, nullptr, nullptr, nullptr, nullptr ) )
{
RegCloseKey( hkey );
hkey = nullptr;
@@ -665,12 +691,12 @@ STDAPI DllUnregisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAcc
fErr = TRUE;
else
{
- if ( ERROR_SUCCESS != RegDeleteValue( hkey, "Content Type" ) )
+ if ( ERROR_SUCCESS != RegDeleteValueA( hkey, "Content Type" ) )
fErr = TRUE;
- if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, nullptr, nullptr, nullptr,
- &nSubKeys, nullptr, nullptr,
- &nValues, nullptr, nullptr, nullptr, nullptr ) )
+ if ( ERROR_SUCCESS != RegQueryInfoKeyA( hkey, nullptr, nullptr, nullptr,
+ &nSubKeys, nullptr, nullptr,
+ &nValues, nullptr, nullptr, nullptr, nullptr ) )
{
RegCloseKey( hkey );
hkey = nullptr;
@@ -709,14 +735,14 @@ STDAPI DllRegisterServer()
{
HRESULT aResult = E_FAIL;
- HMODULE aCurModule = GetModuleHandleA( bX64 ? X64_LIB_NAME : X32_LIB_NAME );
+ HMODULE aCurModule = GetModuleHandleW( bX64 ? X64_LIB_NAME : X32_LIB_NAME );
DWORD nLibNameLen = sal::static_int_cast<DWORD>(
- strlen((bX64) ? X64_LIB_NAME : X32_LIB_NAME));
+ wcslen((bX64) ? X64_LIB_NAME : X32_LIB_NAME));
if( aCurModule )
{
- char pProgramPath[1024];
- DWORD nLen = GetModuleFileNameA( aCurModule, pProgramPath, 1024 );
+ wchar_t pProgramPath[1024];
+ DWORD nLen = GetModuleFileNameW( aCurModule, pProgramPath, 1024 );
if ( nLen && nLen > nLibNameLen + 1 )
{
pProgramPath[ nLen - nLibNameLen - 1 ] = 0;
diff --git a/extensions/source/ole/wincrap.hxx b/extensions/source/ole/wincrap.hxx
index 426195a8d38b..485c8c0aef67 100644
--- a/extensions/source/ole/wincrap.hxx
+++ b/extensions/source/ole/wincrap.hxx
@@ -34,7 +34,6 @@
#pragma warning (disable:4005)
#pragma warning (disable:4548)
-#include <tchar.h>
#include <dispex.h>
#include <prewin.h>
diff --git a/extensions/source/update/check/onlinecheck.cxx b/extensions/source/update/check/onlinecheck.cxx
index 1568f848a2ed..be6912f17afb 100644
--- a/extensions/source/update/check/onlinecheck.cxx
+++ b/extensions/source/update/check/onlinecheck.cxx
@@ -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),
diff --git a/extensions/test/ole/AxTestComponents/StdAfx.h b/extensions/test/ole/AxTestComponents/StdAfx.h
index eed60448a599..da6810aea051 100644
--- a/extensions/test/ole/AxTestComponents/StdAfx.h
+++ b/extensions/test/ole/AxTestComponents/StdAfx.h
@@ -39,7 +39,6 @@
extern CComModule _Module;
#include <atlcom.h>
#include <stdio.h>
-#include <tchar.h>
#include <string.h>
//{{AFX_INSERT_LOCATION}}
diff --git a/extensions/test/ole/OleConverterVar1/convTest.cxx b/extensions/test/ole/OleConverterVar1/convTest.cxx
index a3ac2a23d45d..c0acc3152abf 100644
--- a/extensions/test/ole/OleConverterVar1/convTest.cxx
+++ b/extensions/test/ole/OleConverterVar1/convTest.cxx
@@ -24,7 +24,6 @@
#endif
#include <windows.h>
#include <comdef.h>
-#include <tchar.h>
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
@@ -63,23 +62,23 @@ void printResultVariantArray( VARIANT & var);
void printVariant( VARIANT & var);
-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;
}
- _Module.Init( ObjectMap, GetModuleHandle( NULL));
+ _Module.Init( ObjectMap, GetModuleHandleA( NULL));
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);
}
@@ -292,8 +291,8 @@ HRESULT doTest()
V_DISPATCHREF(&varOutXInterface)= &dispOut.p;
// In Parameter ( all of type Sequence ###########################################################
- OutputDebugString( _T("In parameter of type Sequence ###########################################\n"
- "The functions return the Sequence parameter \n\n"));
+ OutputDebugStringA( "In parameter of type Sequence ###########################################\n"
+ "The functions return the Sequence parameter \n\n");
OutputDebugStringA("methodByte | Params: \n");
printVariant( varByteArray);
@@ -338,48 +337,48 @@ HRESULT doTest()
printVariant( varRet);
// Out Parameter ###########################################################################
- OutputDebugString( _T("Out parameter ###########################################\n\n"));
+ OutputDebugStringA("Out parameter ###########################################\n\n");
- OutputDebugString(_T("testout_methodByte \n"));
+ OutputDebugStringA("testout_methodByte \n");
hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testout_methodByte"), &varOutByte, 1, &varRet);
- OutputDebugString(_T("testout_methodByte | out value: \n"));
+ OutputDebugStringA("testout_methodByte | out value: \n");
printVariant( varOutByte);
- OutputDebugString(_T("testout_methodShort \n"));
+ OutputDebugStringA("testout_methodShort \n");
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodShort"), &varOutShort, &varRet);
- OutputDebugString(_T("testout_methodShort | out value: \n"));
+ OutputDebugStringA("testout_methodShort | out value: \n");
printVariant( varOutShort);
- OutputDebugString(_T("testout_methodLong \n"));
+ OutputDebugStringA("testout_methodLong \n");
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodLong"), &varOutLong, &varRet);
- OutputDebugString(_T("testout_methodLong | out value: \n"));
+ OutputDebugStringA("testout_methodLong | out value: \n");
printVariant( varOutLong);
- OutputDebugString(_T("testout_methodDouble \n"));
+ OutputDebugStringA("testout_methodDouble \n");
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodDouble"), &varOutDouble, &varRet);
- OutputDebugString(_T("testout_methodDouble | out value: \n"));
+ OutputDebugStringA("testout_methodDouble | out value: \n");
printVariant( varOutDouble);
- OutputDebugString(_T("testout_methodString \n"));
+ OutputDebugStringA("testout_methodString \n");
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodString"), &varOutString, &varRet);
- OutputDebugString(_T("testout_methodString | out value: \n"));
+ OutputDebugStringA("testout_methodString | out value: \n");
printVariant( varOutString);
- OutputDebugString(_T("testout_methodAny \n"));
+ OutputDebugStringA("testout_methodAny \n");
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodAny"), &varOutAny, &varRet);
- OutputDebugString(_T("methodAny | out value: \n"));
+ OutputDebugStringA("methodAny | out value: \n");
printVariant( varOutAny);
- OutputDebugString(_T("testout_methodXInterface \n"));
+ OutputDebugStringA("testout_methodXInterface \n");
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodXInterface"), &varOutXInterface, &varRet);
- OutputDebugString(_T("methodAny | out value: \n"));
+ OutputDebugStringA("methodAny | out value: \n");
printVariant( varOutXInterface);
CComDispatchDriver outDisp( *varOutXInterface.ppdispVal);
CComVariant varAttr3;
outDisp.GetPropertyByName(L"AttrAny2", &varAttr3);
- ATLTRACE("property OleTest.AttrAny2: %s", W2T(varAttr3.bstrVal));
+ ATLTRACE("property OleTest.AttrAny2: %s", W2A(varAttr3.bstrVal));
- OutputDebugString(_T("testout_methodMulParams1 ( 2 out Parameter) \n"));
+ OutputDebugStringA("testout_methodMulParams1 ( 2 out Parameter) \n");
long longOut2=0;
CComVariant _params[2];
longOut=0;
@@ -387,72 +386,72 @@ HRESULT doTest()
_params[1].vt= VT_BYREF | VT_I4;
V_I4REF(& _params[1])= &longOut2;
hr= oletest.InvokeN( static_cast<LPCOLESTR>(L"testout_methodMulParams1"), (VARIANT*)&_params, 2);
- OutputDebugString(_T("testout_methodMulParams1 | out values: \n"));
+ OutputDebugStringA("testout_methodMulParams1 | out values: \n");
printVariant( _params[1]);
printVariant( _params[0]);
- OutputDebugString(_T("testout_methodMulParams2 ( 3 out Parameter) \n"));
+ OutputDebugStringA("testout_methodMulParams2 ( 3 out Parameter) \n");
CComVariant _params2[3];
_params2[2]= varOutLong;
_params2[1].vt= VT_BYREF | VT_I4;
V_I4REF(& _params2[1])= &longOut2;
_params2[0]= varOutString;
hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams2"), (VARIANT*)&_params2, 3);
- OutputDebugString(_T("testout_methodMulParams2 | out values: \n"));
+ OutputDebugStringA("testout_methodMulParams2 | out values: \n");
printVariant( _params2[2]);
printVariant( _params2[1]);
printVariant( _params2[0]);
- OutputDebugString(_T("testout_methodMulParams3 ( 1 in and 1 out Parameter) \n"));
+ OutputDebugStringA("testout_methodMulParams3 ( 1 in and 1 out Parameter) \n");
CComVariant _params3[2];
_params3[1]= CComBSTR(L" In string");
_params3[0]= varOutString;
hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams3"), (VARIANT*)&_params3, 2);
- OutputDebugString(_T("testout_methodMulParams3 | out values: \n"));
+ OutputDebugStringA("testout_methodMulParams3 | out values: \n");
printVariant( _params3[1]);
printVariant( _params3[0]);
//In Out Parameter ###########################################################################
- OutputDebugString( _T("In Out parameter ###########################################\n\n"));
+ OutputDebugStringA("In Out parameter ###########################################\n\n");
*V_I1REF(&varOutByte)= 5;
- ATLTRACE(_T("testinout_methodByte | in value: %d \n"), *V_I1REF(&varOutByte));
+ ATLTRACE("testinout_methodByte | in value: %d \n", *V_I1REF(&varOutByte));
hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varOutByte, 1, &varRet);
- OutputDebugString(_T("testinout_methodByte | out value: \n"));
+ OutputDebugStringA("testinout_methodByte | out value: \n");
printVariant( varOutByte);
- OutputDebugString(_T("testinout_methodShort | in value= 1000 \n"));
+ OutputDebugStringA("testinout_methodShort | in value= 1000 \n");
*V_UI2REF(&varOutShort)= 1000;
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodShort"), &varOutShort, &varRet);
- OutputDebugString(_T("testinout_methodShort | out value: \n"));
+ OutputDebugStringA("testinout_methodShort | out value: \n");
printVariant( varOutShort);
- OutputDebugString(_T("testinout_methodLong | in value= 10000 \n"));
+ OutputDebugStringA("testinout_methodLong | in value= 10000 \n");
*V_UI4REF(&varOutLong)= 10000;
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodLong"), &varOutLong, &varRet);
- OutputDebugString(_T("testinout_methodLong | out value: \n"));
+ OutputDebugStringA("testinout_methodLong | out value: \n");
printVariant( varOutLong);
*V_R8REF(&varOutDouble)= 3.14;
- ATLTRACE(_T("testinou_methodDouble in value: %f \n"),*V_R8REF(&varOutDouble));
+ ATLTRACE("testinou_methodDouble in value: %f \n",*V_R8REF(&varOutDouble));
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodDouble"), &varOutDouble, &varRet);
- OutputDebugString(_T("testinout_methodDouble | out value: \n"));
+ OutputDebugStringA("testinout_methodDouble | out value: \n");
printVariant( varOutDouble);
SysFreeString( *V_BSTRREF(&varOutString));
*V_BSTRREF(&varOutString)= SysAllocString( L"this is a in string");
- ATLTRACE(_T("testinout_methodString | value: %s \n"), W2T(*V_BSTRREF(&varOutString)));
+ ATLTRACE("testinout_methodString | value: %s \n", W2A(*V_BSTRREF(&varOutString)));
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodString"), &varOutString, &varRet);
- OutputDebugString(_T("testinout_methodString | out value: \n"));
+ OutputDebugStringA("testinout_methodString | out value: \n");
printVariant( varOutString);
CComVariant var1(CComBSTR(L" this is a string in a VARIANT"));
CComVariant outVar1;
outVar1.vt= VT_BYREF | VT_VARIANT;
outVar1.pvarVal= &var1;
- ATLTRACE(_T("testinout_methodAny | parameter: %s\n"), W2T(var1.bstrVal));
+ ATLTRACE("testinout_methodAny | parameter: %s\n", W2A(var1.bstrVal));
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodAny"), &varOutAny, &varRet);
- OutputDebugString(_T("testinout_methodAny | out value: \n"));
+ OutputDebugStringA("testinout_methodAny | out value: \n");
printVariant( varOutAny);
CComPtr< IUnknown > objectIn = unk1;
@@ -460,22 +459,22 @@ HRESULT doTest()
varOutIFace.vt= VT_BYREF | VT_UNKNOWN;
varOutIFace.ppunkVal= &objectIn.p;
(*varOutIFace.ppunkVal)->AddRef();
- OutputDebugString(_T("testinout_methodXInterface | in value: \n"));
+ OutputDebugStringA("testinout_methodXInterface | in value: \n");
printVariant(varOutIFace);
hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodXInterface"), &varOutIFace, &varRet);
- OutputDebugString(_T("testinout_methodXInterface | out value: \n"));
+ OutputDebugStringA("testinout_methodXInterface | out value: \n");
printVariant( varOutIFace);
// Properties ######################################################################
- OutputDebugString( _T(" Properties ###########################################\n\n"));
+ OutputDebugStringA(" Properties ###########################################\n\n");
- OutputDebugString(_T("set property \"AttrByte\" | value"));
+ OutputDebugStringA("set property \"AttrByte\" | value");
//CComVariant propArByte;
//propArByte.vt= VT_ARRAY | VT_I1;
varParam1.parray= (SAFEARRAY*)arByte;
printVariant( varParam1);
hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varParam1);
- OutputDebugString(_T("get property \"AttrByte\" | value:"));
+ OutputDebugStringA("get property \"AttrByte\" | value:");
varRet.Clear();
hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varRet);
printVariant( varRet);
@@ -509,13 +508,13 @@ void printVariant( VARIANT & _var)
double doubleValue;
IUnknown* unkValue;
BSTR bstrValue;
- OutputDebugString( _T("# Array \n"));
+ OutputDebugStringA("# Array \n");
for( long i= 0; i < count; i++)
{
// CComVariant variantValue;
- TCHAR *buf[256];
- wsprintf( (TCHAR*)buf, _T("%d : "), i);
- OutputDebugString( (TCHAR*)buf);
+ CHAR buf[256];
+ wsprintfA( buf, "%d : ", i);
+ OutputDebugStringA( buf);
VARIANT varTemp;
VariantInit( &varTemp);
VARIANT variantValue;
@@ -580,17 +579,17 @@ void printVariant( VARIANT & _var)
}
else
{
- TCHAR buf[256];
+ CHAR buf[256];
switch (var.vt)
{
- case VT_I1: wsprintf( (TCHAR*)buf, _T(" VT_I1: %d \n"), V_I1( &var) );
+ case VT_I1: wsprintfA( buf, " VT_I1: %d \n", V_I1( &var) );
break;
- case VT_UI1: wsprintf( (TCHAR*)buf, _T(" VT_UI1: %d \n"), V_I1( &var) );
+ case VT_UI1: wsprintfA( buf, " VT_UI1: %d \n", V_I1( &var) );
break;
- case VT_I2: wsprintf( (TCHAR*)buf, _T(" VT_I2: %d \n"), V_I2( &var) );
+ case VT_I2: wsprintfA( buf, " VT_I2: %d \n", V_I2( &var) );
break;
- case VT_I4: wsprintf( (TCHAR*)buf, _T(" VT_I4: %d \n"), V_I4( &var) );
+ case VT_I4: wsprintfA( buf, " VT_I4: %d \n", V_I4( &var) );
break;
case VT_R8:
{
@@ -601,7 +600,7 @@ void printVariant( VARIANT & _var)
// double source = 3.1415926535;
// buffer = _ecvt( V_R8(&var), precision, &decimal, &sign );
- sprintf( (TCHAR*)buf, _T(" VT_R8: %f \n"),V_R8( &var) );
+ sprintf( buf, " VT_R8: %f \n",V_R8( &var) );
break;
}
case VT_UNKNOWN:
@@ -610,7 +609,7 @@ void printVariant( VARIANT & _var)
CComDispatchDriver disp( var.punkVal);
CComVariant ret;
hr= disp.GetPropertyByName( static_cast<LPCOLESTR>(L"Name"), &ret);
- wsprintf( (TCHAR*)buf, _T(" VT_UNKNOWN: property \"Name\": %s \n"), W2T(ret.bstrVal));
+ wsprintfA( buf, " VT_UNKNOWN: property \"Name\": %s \n", W2A(ret.bstrVal));
break;
}
case VT_DISPATCH:
@@ -619,9 +618,9 @@ void printVariant( VARIANT & _var)
CComDispatchDriver disp( var.punkVal);
CComVariant ret;
if( SUCCEEDED( hr= disp.GetPropertyByName( static_cast<LPCOLESTR>(L"Name"), &ret)))
- wsprintf( (TCHAR*)buf, _T(" VT_DISPATCH: property \"Name\": %s \n"), W2T(ret.bstrVal));
+ wsprintfA( buf, " VT_DISPATCH: property \"Name\": %s \n", W2A(ret.bstrVal));
else
- wsprintf( (TCHAR*)buf, _T(" VT_DISPATCH \n"));
+ wsprintfA( buf, " VT_DISPATCH \n");
break;
}
@@ -629,16 +628,16 @@ void printVariant( VARIANT & _var)
case VT_BSTR:
{
- TCHAR* str= W2T( var.bstrVal);
- wsprintf( (TCHAR*)buf, _T(" VT_BSTR: %s \n"), str);
+ CHAR* str= W2A( var.bstrVal);
+ wsprintfA( buf, " VT_BSTR: %s \n", str);
}
break;
default:
- wsprintf( (TCHAR*)buf, _T("\n"));
+ wsprintfA( buf, "\n");
}
- OutputDebugString( (TCHAR*) buf);
+ OutputDebugStringA( buf);
}
return;
diff --git a/extensions/test/ole/cppToUno/testcppuno.cxx b/extensions/test/ole/cppToUno/testcppuno.cxx
index 0b06d694cde3..563e2d0acc06 100644
--- a/extensions/test/ole/cppToUno/testcppuno.cxx
+++ b/extensions/test/ole/cppToUno/testcppuno.cxx
@@ -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();
diff --git a/extensions/test/ole/cpptest/cpptest.cxx b/extensions/test/ole/cpptest/cpptest.cxx
index 2fd41394e923..d97489847399 100644
--- a/extensions/test/ole/cpptest/cpptest.cxx
+++ b/extensions/test/ole/cpptest/cpptest.cxx
@@ -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();
diff --git a/extensions/test/ole/unoTocomCalls/Test/StdAfx.h b/extensions/test/ole/unoTocomCalls/Test/StdAfx.h
index 93e2da1c0c88..e60a425b2502 100644
--- a/extensions/test/ole/unoTocomCalls/Test/StdAfx.h
+++ b/extensions/test/ole/unoTocomCalls/Test/StdAfx.h
@@ -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>
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h
index 8124560e5e5f..d7262d1ec595 100644
--- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.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.