From 980ff19c95139a9dab3db9c5b4179e56087a61ae Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 4 Jun 2012 18:41:10 +0000 Subject: [PATCH] [UPDATE_COMPONENT] (Author: Loreia L.) Make NppShell compilable under Visual Studio 2008. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@915 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../tools/NppShell/project/NppShell.vcproj | 199 +++++++++--------- PowerEditor/src/tools/NppShell/src/Bitmap.h | 2 + .../src/tools/NppShell/src/NppShell.cpp | 6 +- PowerEditor/src/tools/NppShell/src/NppShell.h | 11 +- 4 files changed, 111 insertions(+), 107 deletions(-) diff --git a/PowerEditor/src/tools/NppShell/project/NppShell.vcproj b/PowerEditor/src/tools/NppShell/project/NppShell.vcproj index 39eed9a8..d669537e 100644 --- a/PowerEditor/src/tools/NppShell/project/NppShell.vcproj +++ b/PowerEditor/src/tools/NppShell/project/NppShell.vcproj @@ -1,11 +1,12 @@ + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - @@ -299,8 +300,9 @@ RuntimeLibrary="2" BufferSecurityCheck="false" UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" + WarningLevel="4" + WarnAsError="true" + Detect64BitPortabilityProblems="false" DebugInformationFormat="3" /> - diff --git a/PowerEditor/src/tools/NppShell/src/Bitmap.h b/PowerEditor/src/tools/NppShell/src/Bitmap.h index 2e0b101b..da1f1fae 100644 --- a/PowerEditor/src/tools/NppShell/src/Bitmap.h +++ b/PowerEditor/src/tools/NppShell/src/Bitmap.h @@ -1,7 +1,9 @@ #include #include +#ifndef BPPF_ERASE #define BPPF_ERASE 1 +#endif typedef DWORD ARGB; typedef HRESULT (WINAPI *FN_GetBufferedPaintBits) (HPAINTBUFFER hBufferedPaint, RGBQUAD **ppbBuffer, int *pcxRow); diff --git a/PowerEditor/src/tools/NppShell/src/NppShell.cpp b/PowerEditor/src/tools/NppShell/src/NppShell.cpp index eef85348..5557341b 100644 --- a/PowerEditor/src/tools/NppShell/src/NppShell.cpp +++ b/PowerEditor/src/tools/NppShell/src/NppShell.cpp @@ -120,8 +120,6 @@ STDAPI DllInstall(BOOL bInstall, LPCWSTR /*pszCmdLine*/) { MsgBoxError(TEXT("Uninstalling not supported, use DllUnregisterServer instead")); return E_NOTIMPL; } - - return S_OK; } //--------------------------------------------------------------------------- @@ -673,7 +671,7 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) { return hr; } -STDMETHODIMP CShellExt::GetCommandString(UINT_PTR /*idCmd*/, UINT uFlags, UINT FAR */*reserved*/, LPSTR pszName, UINT cchMax) { +STDMETHODIMP CShellExt::GetCommandString(UINT_PTR, UINT uFlags, UINT FAR *, LPSTR pszName, UINT cchMax) { LPWSTR wBuffer = (LPWSTR) pszName; if (uFlags == GCS_HELPTEXTA) { lstrcpynA(pszName, szHelpTextA, cchMax); @@ -1025,7 +1023,7 @@ STDMETHODIMP CShellExt::InvokeNPP(HWND /*hParent*/, LPCSTR /*pszWorkingDir*/, LP ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); si.dwFlags = STARTF_USESHOWWINDOW; - si.wShowWindow = iShowCmd; //SW_RESTORE; + si.wShowWindow = (WORD)iShowCmd; //SW_RESTORE; if (!CreateProcess (NULL, pszCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { DWORD errorCode = GetLastError(); if (errorCode == ERROR_ELEVATION_REQUIRED) { //Fallback to shellexecute diff --git a/PowerEditor/src/tools/NppShell/src/NppShell.h b/PowerEditor/src/tools/NppShell/src/NppShell.h index 6a4c1cbd..aa915856 100644 --- a/PowerEditor/src/tools/NppShell/src/NppShell.h +++ b/PowerEditor/src/tools/NppShell/src/NppShell.h @@ -19,7 +19,10 @@ #define WINVER_VISTA 0x600 //This is not ideal, but missing from current mingw +#ifndef ERROR_ELEVATION_REQUIRED #define ERROR_ELEVATION_REQUIRED 740 +#endif + #define GIL_DEFAULTICON 0x0040 #define GUID_SIZE 128 @@ -114,11 +117,11 @@ public: STDMETHODIMP HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult); // *** IPersistFile methods *** - STDMETHODIMP GetClassID(CLSID */*pClassID*/) { return E_NOTIMPL; }; + STDMETHODIMP GetClassID(CLSID *) { return E_NOTIMPL; }; STDMETHODIMP IsDirty(void) { return E_NOTIMPL; }; - STDMETHODIMP Save(LPCOLESTR /*pszFileName*/, BOOL /*fRemember*/) { return E_NOTIMPL; }; - STDMETHODIMP SaveCompleted(LPCOLESTR /*pszFileName*/) { return E_NOTIMPL; }; - STDMETHODIMP GetCurFile(LPOLESTR */*ppszFileName*/) { return E_NOTIMPL; }; + STDMETHODIMP Save(LPCOLESTR, BOOL) { return E_NOTIMPL; }; + STDMETHODIMP SaveCompleted(LPCOLESTR) { return E_NOTIMPL; }; + STDMETHODIMP GetCurFile(LPOLESTR *) { return E_NOTIMPL; }; STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode); // *** IExtractIcon methods ***