X Tutup
Skip to content

Commit 3ca0fa4

Browse files
Henrik "Henke37" Anderssonsev-
authored andcommitted
WIN32: Use TCHAR in printing code
1 parent 939621d commit 3ca0fa4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

backends/printing/win32/win32-printman.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Win32PrintingManager : public Common::PrintingManager {
3838

3939
private:
4040
HDC createDefaultPrinterContext();
41-
HDC createPrinterContext(LPWSTR devName);
41+
HDC createPrinterContext(LPTSTR devName);
4242
HBITMAP buildBitmap(HDC hdc, const Graphics::ManagedSurface &surf);
4343
};
4444

@@ -72,32 +72,32 @@ void Win32PrintingManager::printImage(const Common::String &jobName, const Graph
7272
}
7373

7474
HDC Win32PrintingManager::createDefaultPrinterContext() {
75-
wchar_t szPrinter[MAX_PATH];
75+
TCHAR szPrinter[MAX_PATH];
7676
BOOL success;
7777
DWORD cchPrinter(ARRAYSIZE(szPrinter));
7878

79-
success = GetDefaultPrinterW(szPrinter, &cchPrinter);
79+
success = GetDefaultPrinter(szPrinter, &cchPrinter);
8080
if (!success)
8181
return NULL;
8282

8383
return createPrinterContext(szPrinter);
8484
}
8585

86-
HDC Win32PrintingManager::createPrinterContext(LPWSTR devName) {
86+
HDC Win32PrintingManager::createPrinterContext(LPTSTR devName) {
8787
HANDLE handle;
8888
BOOL success;
8989

90-
success = OpenPrinterW(devName, &handle, NULL);
90+
success = OpenPrinter(devName, &handle, NULL);
9191
if (!success)
9292
return NULL;
9393

94-
int size = DocumentPropertiesW(NULL, handle, devName, NULL, NULL, 0);
94+
int size = DocumentProperties(NULL, handle, devName, NULL, NULL, 0);
9595
DEVMODE *devmode = (DEVMODE *)malloc(size);
96-
DocumentPropertiesW(NULL, handle, devName, devmode, NULL, DM_OUT_BUFFER);
96+
DocumentProperties(NULL, handle, devName, devmode, NULL, DM_OUT_BUFFER);
9797

9898
ClosePrinter(handle);
9999

100-
HDC printerDC = CreateDCW(L"WINSPOOL", devName, NULL, devmode);
100+
HDC printerDC = CreateDC(TEXT("WINSPOOL"), devName, NULL, devmode);
101101
return printerDC;
102102
}
103103

0 commit comments

Comments
 (0)
X Tutup