From: Julian Smart Date: Thu, 7 Oct 2004 16:26:58 +0000 (+0000) Subject: Applied patch [ 1042241 ] Fixes print setup problem (MSW UNICODE build) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a527830a2eb4b9100c272297d737b9aaa4bd29c7 Applied patch [ 1042241 ] Fixes print setup problem (MSW UNICODE build) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index c6208b0e8c..e10ea9b085 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -293,16 +293,16 @@ static HGLOBAL wxCreateDevNames(const wxString& driverName, const wxString& prin printerName.Length() + 1 + portName.Length()+1 ) * sizeof(wxChar) ); LPDEVNAMES lpDev = (LPDEVNAMES)GlobalLock(hDev); - lpDev->wDriverOffset = sizeof(WORD)*4; - wxStrcpy((wxChar*)((char*)lpDev + lpDev->wDriverOffset ), driverName); + lpDev->wDriverOffset = sizeof(WORD) * 4 / sizeof(wxChar); + wxStrcpy((wxChar*)lpDev + lpDev->wDriverOffset, driverName); lpDev->wDeviceOffset = (WORD)( lpDev->wDriverOffset + - sizeof(wxChar) * ( driverName.Length() + 1 ) ); - wxStrcpy((wxChar*)((char*)lpDev + lpDev->wDeviceOffset ), printerName); + driverName.Length() + 1 ); + wxStrcpy((wxChar*)lpDev + lpDev->wDeviceOffset, printerName); lpDev->wOutputOffset = (WORD)( lpDev->wDeviceOffset + - sizeof(wxChar) * ( printerName.Length() + 1 ) ); - wxStrcpy((wxChar*)((char*) lpDev + lpDev->wOutputOffset ), portName); + printerName.Length() + 1 ); + wxStrcpy((wxChar*)lpDev + lpDev->wOutputOffset, portName); lpDev->wDefault = 0;