Fixed various bugs introduced by previous commit.

This commit is contained in:
Quantum 2013-09-07 20:49:02 -04:00
parent f84ad63e63
commit 3a75c33e4a
2 changed files with 9 additions and 4 deletions

View file

@ -11,8 +11,8 @@ void MainWindow::OnLoadFile()
HANDLE file = INVALID_HANDLE_VALUE, mapping = 0; HANDLE file = INVALID_HANDLE_VALUE, mapping = 0;
LPSTR data = NULL; LPSTR data = NULL;
LPWSTR storage = NULL; LPWSTR storage = NULL;
int codepage = 0 int codepage;
DWORD size = 0, length = 0; DWORD size, length;
ofn.hwndOwner = m_hwnd; ofn.hwndOwner = m_hwnd;
ofn.lpstrFilter = L"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"; ofn.lpstrFilter = L"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
@ -88,8 +88,8 @@ void MainWindow::OnSaveFile()
LPSTR storage = NULL; LPSTR storage = NULL;
HANDLE file = INVALID_HANDLE_VALUE; HANDLE file = INVALID_HANDLE_VALUE;
HLOCAL buf = NULL; HLOCAL buf = NULL;
int codepage = 0; int codepage;
DWORD length = 0, size = 0, written = 0; DWORD length, size, written;
ofn.hwndOwner = m_hwnd; ofn.hwndOwner = m_hwnd;
ofn.lpstrFilter = L"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"; ofn.lpstrFilter = L"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";

View file

@ -3,6 +3,11 @@
#include <resource.h> #include <resource.h>
#include <windowsx.h> #include <windowsx.h>
#ifndef max
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
LRESULT PreviewWindow::OnCreate() LRESULT PreviewWindow::OnCreate()
{ {
LOGFONT lf; LOGFONT lf;