From e521b812384a0e93f48e078c6cb248913dcc893a Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Fri, 15 Jun 2012 20:04:13 +0000 Subject: another portion of "#ifsef Unicode" removal git-svn-id: http://svn.miranda-ng.org/main/trunk@437 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StatusPlugins/StartupStatus/options.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'plugins/StatusPlugins/StartupStatus/options.cpp') diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 3aef57390c..992fe13701 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -185,33 +185,23 @@ HRESULT CreateLink(TSettingsList& protoSettings) TCHAR path[MAX_PATH]; GetModuleFileName(NULL, path, SIZEOF(path)); psl->SetPath(path); - #if defined( _UNICODE ) + TCHAR* p = mir_a2t( desc ); psl->SetDescription( p ); mir_free( p ); p = mir_a2t( args ); psl->SetArguments( p ); mir_free( p ); - #else - psl->SetDescription(desc); - psl->SetArguments(args); - #endif - + // Query IShellLink for the IPersistFile interface for saving the // shortcut in persistent storage. IPersistFile* ppf; hres = psl->QueryInterface(IID_IPersistFile, ( void** )&ppf); if (SUCCEEDED(hres)) { - #if defined( _UNICODE ) - WCHAR* wsz = savePath; - #else - WCHAR wsz[MAX_PATH]; - - // Ensure that the string is ANSI. - MultiByteToWideChar(CP_ACP, 0, savePath, -1, wsz, MAX_PATH); - #endif + WCHAR* wsz = savePath; + // Save the link by calling IPersistFile::Save. hres = ppf->Save(wsz, TRUE); ppf->Release(); @@ -959,11 +949,8 @@ int OptionsInit(WPARAM wparam,LPARAM lparam) } // from: http://www.codeproject.com/winhelp/msdnintegrator/ -#ifdef _UNICODE + static const CHAR _szSpecialFolderPath[] = "SHGetSpecialFolderPathW"; -#else - static const CHAR _szSpecialFolderPath[] = "SHGetSpecialFolderPathA"; -#endif BOOL MyGetSpecialFolderPath(HWND hwndOwner, LPTSTR lpszPath, int nFolder, BOOL fCreate) { -- cgit v1.2.3