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
This commit is contained in:
Julian Smart 2004-10-07 16:26:58 +00:00
parent 373a5fb355
commit a527830a2e

View File

@ -293,16 +293,16 @@ static HGLOBAL wxCreateDevNames(const wxString& driverName, const wxString& prin
printerName.Length() + 1 + printerName.Length() + 1 +
portName.Length()+1 ) * sizeof(wxChar) ); portName.Length()+1 ) * sizeof(wxChar) );
LPDEVNAMES lpDev = (LPDEVNAMES)GlobalLock(hDev); LPDEVNAMES lpDev = (LPDEVNAMES)GlobalLock(hDev);
lpDev->wDriverOffset = sizeof(WORD)*4; lpDev->wDriverOffset = sizeof(WORD) * 4 / sizeof(wxChar);
wxStrcpy((wxChar*)((char*)lpDev + lpDev->wDriverOffset ), driverName); wxStrcpy((wxChar*)lpDev + lpDev->wDriverOffset, driverName);
lpDev->wDeviceOffset = (WORD)( lpDev->wDriverOffset + lpDev->wDeviceOffset = (WORD)( lpDev->wDriverOffset +
sizeof(wxChar) * ( driverName.Length() + 1 ) ); driverName.Length() + 1 );
wxStrcpy((wxChar*)((char*)lpDev + lpDev->wDeviceOffset ), printerName); wxStrcpy((wxChar*)lpDev + lpDev->wDeviceOffset, printerName);
lpDev->wOutputOffset = (WORD)( lpDev->wDeviceOffset + lpDev->wOutputOffset = (WORD)( lpDev->wDeviceOffset +
sizeof(wxChar) * ( printerName.Length() + 1 ) ); printerName.Length() + 1 );
wxStrcpy((wxChar*)((char*) lpDev + lpDev->wOutputOffset ), portName); wxStrcpy((wxChar*)lpDev + lpDev->wOutputOffset, portName);
lpDev->wDefault = 0; lpDev->wDefault = 0;