diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index d040da77..e9eb3240 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -19,20 +19,6 @@ WcharMbcsConvertor * WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor; -void systemMessage(const TCHAR *title) -{ - LPVOID lpMsgBuf; - FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - ::GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL );// Process any inserts in lpMsgBuf. - MessageBox( NULL, (LPTSTR)lpMsgBuf, title, MB_OK | MB_ICONSTOP); - ::LocalFree(lpMsgBuf); -} - void printInt(int int2print) { TCHAR str[32]; diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index 61a4bb9e..e61be4ae 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -73,14 +73,11 @@ typedef std::basic_string generic_string; void folderBrowser(HWND parent, int outputCtrlID, const TCHAR *defaultStr = NULL); -void systemMessage(const TCHAR *title); -//DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer); void printInt(int int2print); void printStr(const TCHAR *str2print); void writeLog(const TCHAR *logFileName, const char *log2write); int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep); -//int getCpFromStringValue(const char * encodingStr); generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false); std::vector tokenizeString(const generic_string & tokenString, const char delim); diff --git a/PowerEditor/src/MISC/Process/Process.cpp b/PowerEditor/src/MISC/Process/Process.cpp index 0c0625f0..4fba6525 100644 --- a/PowerEditor/src/MISC/Process/Process.cpp +++ b/PowerEditor/src/MISC/Process/Process.cpp @@ -40,11 +40,11 @@ BOOL Process::run() try { // Create stdout pipe if (!::CreatePipe(&_hPipeOutR, &hPipeOutW, &sa, 0)) - error(TEXT("CreatePipe"), result, 1000); + throw std::runtime_error("Create stdout pipe failed"); // Create stderr pipe if (!::CreatePipe(&_hPipeErrR, &hPipeErrW, &sa, 0)) - error(TEXT("CreatePipe"), result, 1001); + throw std::runtime_error("Create stderr pipe failed"); STARTUPINFO startup; PROCESS_INFORMATION procinfo; @@ -80,17 +80,17 @@ BOOL Process::run() _hProcessThread = procinfo.hThread; if(!started) - error(TEXT("CreateProcess"), result, 1002); + throw std::runtime_error("CreateProcess function call failed"); if (_type == CONSOLE_PROG) { hListenerEvent[0] = ::CreateEvent(NULL, FALSE, FALSE, TEXT("listenerEvent")); if(!hListenerEvent[0]) - error(TEXT("CreateEvent"), result, 1003); + throw std::runtime_error("Create listenerEvent failed"); hListenerEvent[1] = ::CreateEvent(NULL, FALSE, FALSE, TEXT("listenerStdErrEvent")); if(!hListenerEvent[1]) - error(TEXT("CreateEvent"), result, 1004); + throw std::runtime_error("Create listenerStdErrEvent failed"); // The process is running so we set this to FALSE @@ -98,15 +98,15 @@ BOOL Process::run() hWaitForProcessEndThread = ::CreateThread(NULL, 0, staticWaitForProcessEnd, this, 0, NULL); if (!hWaitForProcessEndThread) - error(TEXT("CreateThread"), result, 1005); + throw std::runtime_error("CreateThread for staticWaitForProcessEnd failed"); hListenerStdOutThread = ::CreateThread(NULL, 0, staticListenerStdOut, this, 0, NULL); if (!hListenerStdOutThread) - error(TEXT("CreateThread"), result, 1006); + throw std::runtime_error("CreateThread for staticListenerStdOut failed"); hListenerStdErrThread = ::CreateThread(NULL, 0, staticListenerStdErr, this, 0, NULL); if (!hListenerStdErrThread) - error(TEXT("CreateThread"), result, 1007); + throw std::runtime_error("CreateThread for staticListenerStdErr failed"); // We wait until the process is over // TO DO: This should be a bit secured in case something happen and the @@ -222,7 +222,7 @@ void Process::listenerStdOut() if(!::SetEvent(hListenerEvent)) { - systemMessage(TEXT("Thread listenerStdOut")); + ::MessageBox(NULL, TEXT("SetEvent function call failed"), TEXT("Thread listenerStdOut"), MB_OK); } } @@ -278,7 +278,7 @@ void Process::listenerStdErr() if(!::SetEvent(hListenerEvent)) { - systemMessage(TEXT("Thread stdout listener")); + ::MessageBox(NULL, TEXT("SetEvent function call failed"), TEXT("Thread stdout listener"), MB_OK); } } @@ -293,10 +293,3 @@ void Process::waitForProcessEnd() _bProcessEnd = TRUE; } - -void Process::error(const TCHAR *txt2display, BOOL & returnCode, int errCode) -{ - systemMessage(txt2display); - returnCode = FALSE; - throw int(errCode); -} diff --git a/PowerEditor/src/ScitillaComponent/Printer.cpp b/PowerEditor/src/ScitillaComponent/Printer.cpp index c7953fab..446b302b 100644 --- a/PowerEditor/src/ScitillaComponent/Printer.cpp +++ b/PowerEditor/src/ScitillaComponent/Printer.cpp @@ -216,7 +216,7 @@ size_t Printer::doPrint(bool justDoIt) lengthDoc = lengthDocMax; } - RangeToFormat frPrint; + NPP_RangeToFormat frPrint; frPrint.hdc = _pdlg.hDC; frPrint.hdcTarget = _pdlg.hDC; frPrint.rc.left = rectMargins.left - rectPhysMargins.left; diff --git a/PowerEditor/src/ScitillaComponent/Printer.h b/PowerEditor/src/ScitillaComponent/Printer.h index bdfe7e4d..5e0ede36 100644 --- a/PowerEditor/src/ScitillaComponent/Printer.h +++ b/PowerEditor/src/ScitillaComponent/Printer.h @@ -23,7 +23,7 @@ #endif //SCINTILLA_EDIT_VIEW_H -struct RangeToFormat { +struct NPP_RangeToFormat { HDC hdc; HDC hdcTarget; RECT rc; diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp index 6e9ceaec..74956200 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp @@ -36,7 +36,6 @@ void ColourPicker::init(HINSTANCE hInst, HWND parent) (LPVOID)0); if (!_hSelf) { - systemMessage(TEXT("System Err")); throw std::runtime_error("ColourPicker::init : CreateWindowEx() function return null"); } diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index 20d52b08..75c4ff1b 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -141,7 +141,7 @@ RuntimeLibrary="1" UsePrecompiledHeader="1" PrecompiledHeaderThrough="precompiledHeaders.h" - PrecompiledHeaderFile="" + PrecompiledHeaderFile="$(IntDir)\$(TargetName).pch" WarningLevel="4" WarnAsError="true" Detect64BitPortabilityProblems="false" diff --git a/readmeFirst.txt b/readmeFirst.txt index 860d9c0c..10f6209a 100644 --- a/readmeFirst.txt +++ b/readmeFirst.txt @@ -7,18 +7,17 @@ Notepad++ is a free (as in "free speech" and also as in "free beer") source code To build Notepad++ package from source code: ============================================ -For generating the executable file (notepad++.exe), you can use Visual Studio 2005 or MinGW 3.0 / 2.X (a makefile is available, but not maintained). -A CMakeLists.txt (located in the PowerEditor\src directory) is available (but not maintained anymore) for generating the different VC project and MinGW makefile via cmake. - -For generating the the dll file (SciLexer.dll), you have 2 choices : VC++ 6 (from v2.5) or MinGW 3.0 / 2.X +There should be several ways to generate Notepad++ binaries, here we show you only the way with which Notepad++ official releases are generated. +* notepad++.exe: Visual Studio 2005 +* SciLexer.dll: VC++ 6 Notepad++ Unicode release binary (notepad++.exe) and Scintilla release binary (SciLexer.dll) will be built in the directories "notepad++\trunk\PowerEditor\bin" and "notepad++\trunk\scintilla\bin" respectively. You have to copy SciLexer.dll in "notepad++\PowerEditor\bin" in order to launch notepad++.exe Go to Notepad++ official site for more information : -http://notepad-plus.sourceforge.net/ +http://notepad-plus-plus.org/ Notepad++ team -http://sourceforge.net/project/memberlist.php?group_id=95717 +http://notepad-plus-plus.org/members/