diff options
author | pixel <pixel> | 2004-11-27 21:44:44 +0000 |
---|---|---|
committer | pixel <pixel> | 2004-11-27 21:44:44 +0000 |
commit | d38e80ee04afe582e70150d3884e56c05f3fd7a8 (patch) | |
tree | f2627c50fa22aea89447e8406ac418eb68650d3d /PE/pepatch.cpp | |
parent | 50f0dd331f8168fb5b2cd60c70178fad627b7fb6 (diff) |
Large dos2unix commit...
Diffstat (limited to 'PE/pepatch.cpp')
-rw-r--r-- | PE/pepatch.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/PE/pepatch.cpp b/PE/pepatch.cpp index 18e11dd..4cf1e06 100644 --- a/PE/pepatch.cpp +++ b/PE/pepatch.cpp @@ -1,51 +1,51 @@ -#include <Output.h>
-#include <Main.h>
-#include "pepatch-res.h"
-
-BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- Base::printm(M_STATUS, "AboutDlgProc: uMsg = %i (0x%x)\n", uMsg, uMsg);
- switch (uMsg) {
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDCANCEL: DestroyWindow(hW); return TRUE;
- case IDOK: DestroyWindow(hW); return TRUE;
- }
- }
- return FALSE;
-}
-
-CODE_BEGINS
-virtual int startup() throw (GeneralException) {
- verbosity = M_INFO;
- HBITMAP bmp;
- Output * out = new Output("TestBmp.bmp");
- char buffer[2048];
- DWORD readed;
-
- DialogBox(0, MAKEINTRESOURCE(IDD_ABOUT),
- GetActiveWindow(), 0);
-// ShowWindow(CreateDialog(0, MAKEINTRESOURCE(IDD_ABOUT), GetActiveWindow(), AboutDlgProc), SW_SHOWDEFAULT);
- bmp = LoadBitmap(0, MAKEINTRESOURCE(IDB_AYA));
-
- do {
- if (!ReadFile(bmp, buffer, 2048, &readed, 0)) {
- DWORD dwErrCode = GetLastError();
- LPVOID lpMsgBuf;
- if (!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 ))
- throw GeneralException("Gave up on reading CD: unknown error");
- String errmsg = (LPCTSTR) lpMsgBuf;
- LocalFree(lpMsgBuf);
- throw GeneralException("Got error " + errmsg);
- }
- printm(M_INFO, "Read %i bytes\n", readed);
- out->write(buffer, readed);
- } while (readed != 0);
-
- return 0;
-}
-CODE_ENDS
+#include <Output.h> +#include <Main.h> +#include "pepatch-res.h" + +BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) { + Base::printm(M_STATUS, "AboutDlgProc: uMsg = %i (0x%x)\n", uMsg, uMsg); + switch (uMsg) { + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: DestroyWindow(hW); return TRUE; + case IDOK: DestroyWindow(hW); return TRUE; + } + } + return FALSE; +} + +CODE_BEGINS +virtual int startup() throw (GeneralException) { + verbosity = M_INFO; + HBITMAP bmp; + Output * out = new Output("TestBmp.bmp"); + char buffer[2048]; + DWORD readed; + + DialogBox(0, MAKEINTRESOURCE(IDD_ABOUT), + GetActiveWindow(), 0); +// ShowWindow(CreateDialog(0, MAKEINTRESOURCE(IDD_ABOUT), GetActiveWindow(), AboutDlgProc), SW_SHOWDEFAULT); + bmp = LoadBitmap(0, MAKEINTRESOURCE(IDB_AYA)); + + do { + if (!ReadFile(bmp, buffer, 2048, &readed, 0)) { + DWORD dwErrCode = GetLastError(); + LPVOID lpMsgBuf; + if (!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 )) + throw GeneralException("Gave up on reading CD: unknown error"); + String errmsg = (LPCTSTR) lpMsgBuf; + LocalFree(lpMsgBuf); + throw GeneralException("Got error " + errmsg); + } + printm(M_INFO, "Read %i bytes\n", readed); + out->write(buffer, readed); + } while (readed != 0); + + return 0; +} +CODE_ENDS |