PDA

View Full Version : error in Print Dialog (cPrintDialog.pkg)



Michael Mullan
17-May-2010, 06:56 AM
After I send a VRW report to print to printer at a client site, I get the following error
C:\dfdata\CECI14\Programs\CECI.exe
Data Out of Range

Error: 4382

MSG_READDEVMODE (13322) - OOBJECT (2870) - at address 127552
GET_PRINTDIALOG (6558) - OOBJECT (2870) - at address 127691
MSG_PRINTREPORT (6447) - OREPORT (2781) - at address 128297
MSG_STARTREPORT (13007) - OVRWPREVIEWPANEL (2780) - at address 139395
MSG_STARTREPORT (13007) - O3COLUMNREPORTVIEW (2822) - at address 139836
MSG_STARTREPORT (13007) - OPRINTBUTTON (2829) - in native code
MSG_ONCLICK (4574) - OPRINTBUTTON (2829) - at address 139802
MSG_COMMAND (648) - OPRINTBUTTON (2829) - in native code
[start] - at address 140589


address 127552 is
{ Visibility = Private }
Procedure ReadDevMode
Integer iResult iVoid
Handle hDevMode
Pointer pDevMode
DEVMODE dm
.
.some code removed for clarity.
.

If (dm.dmFields iand DM_DITHERTYPE) Begin
Set peDitherType to dm.dmDitherType
End

If (dm.dmFields iand DM_NUP) Begin //<<-- Error Here
Set peNup to dm.dmNup
End

Move (GlobalUnlock (hDevMode)) to iResult
If (iResult = 0) Begin
Move (ShowLastError ()) to iResult
End
End_Procedure


this does not happen on my workstation, but does when I connect via remote desktop to the client PC.

Hendrik van Niekerk
17-May-2010, 08:53 AM
You have to use (Integer(DM_NUP)) I had issues with this as well.

Hope it works for you

Michael Mullan
17-May-2010, 09:49 AM
Thanks Hendrik

I'm on vacation and can't test this until tonight. But I will.

Vincent Oorsprong
17-May-2010, 11:59 PM
Michael,

What version of the OS is on your remote desktop side?

Michael Mullan
18-May-2010, 12:09 AM
XP Pro.

Michael Mullan
18-May-2010, 03:32 PM
I went onsite today, and made the following changes (in red):



If (dm.dmDitherType <= 2147483647) Begin
If (dm.dmFields iand DM_DITHERTYPE) Begin
Set peDitherType to dm.dmDitherType
End
End It's not a fix, it's a patch.

Michael Mullan
18-May-2010, 03:49 PM
OK all the proper fix is this:

In cprintDialog.pkg
Property UInteger peNup
{ Category = "DevMode" }
Property UInteger peICMMethod
{ Category = "DevMode" }
Property UInteger peICMIntent
{ Category = "DevMode" }
Property UInteger peMediaType
{ Category = "DevMode" }
Property UInteger peDitherType

the DeviceMode Struct DEVMODE defines a bunch of its members as UInteger and the matching properties were defined as integers. Blows up on HPlj3005 printer driver.

MM.

PS I Backed out the changes from my earlier post.