Tags: calling, defined, devmode, getjob, incorrect, job_info_2, members, methods, net, populate, sharp, structure, win32

Getting incorrect information from JOB_INFO_2 and DEVMODE

On .Net » .Net C# (C sharp)

1,716 words with 0 Comments; publish: Fri, 08 Feb 2008 20:44:00 GMT; (100170.90, « »)

I have defined the JOB_INFO_2 structure in C# and im calling win32 methods such as GetJob() to populate it. the problem is that the members of the DEVMODE structure contain wrong values. e.g, the dmCopies alwas conatin 101 no matter how many copies i print. can anyone tel me what else i could be missing, could it be in the way data for the strucure is marshalled ?

this is how i defined DEVMODE struct

StructLayout(LayoutKind.Sequential)]

public struct DEVMODE

{

public IntPtr dmDeviceName;

public UInt16 dmSpecVersion;

public UInt16 dmDriverVersion;

public UInt16 dmSize;

public UInt16 dmDriverExtra;

public UInt32 dmFields;

public short dmOrientation;

public short dmPaperSize;

public short dmPaperLength;

public short dmPaperWidth;

public short dmScale;

public short dmCopies;

public short dmDefaultSource;

public short dmPrintQuality;

public short dmColor;

public short dmDuplex;

public short dmYResolution;

public short dmTTOption;

public Int16 dmCollate;

public IntPtr dmFormName;

public UInt16 dmLogPixels;

public UInt32 dmBitsPerPel ;

public UInt32 dmPelsWidth ;

public UInt32 dmPelsHeight ;

public UInt32 dmDisplayFlags ;

public UInt32 dmDisplayFrequency ;

public UInt32 dmDisplayOrientation;

}

another problem is that the TotalPages printed from JOB_INFO_2 is always zero. the documentation sais that its beacause the job does not contain page delimiting information.

How can i get page delimiting inormation from a job?

I have been struggling with this for a while please help

Thanx in advance

All Comments

Leave a comment...

  • 0 Comments