[Migrated content. Thread originally posted on 07 January 2005]
Im trying to define this structure in cobol for an api, but im putting the pictures wrong, because the api returns strange data.typedef struct _devicemode {
BCHAR dmDeviceName[CCHDEVICENAME];
WORD dmSpecVersion;
WORD dmDriverVersion;
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
union {
struct {
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
short dmScale;
short dmCopies;
short dmDefaultSource;
short dmPrintQuality;
};
POINTL dmPosition;
DWORD dmDisplayOrientation;
DWORD dmDisplayFixedOutput;
};
short dmColor;
short dmDuplex;
short dmYResolution;
short dmTTOption;
short dmCollate;
BYTE dmFormName[CCHFORMNAME];
WORD dmLogPixels;
DWORD dmBitsPerPel;
DWORD dmPelsWidth;
DWORD dmPelsHeight;
union {
DWORD dmDisplayFlags;
DWORD dmNup;
}
DWORD dmDisplayFrequency;
#if(WINVER >= 0x0400)
DWORD dmICMMethod;
DWORD dmICMIntent;
DWORD dmMediaType;
DWORD dmDitherType;
DWORD dmReserved1;
DWORD dmReserved2;
#if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
DWORD dmPanningWidth;
DWORD dmPanningHeight;
#endif
#endif /* WINVER >= 0x0400 */
} DEVMODE;
My definition:
01 DevOption.
05 dmDeviceName PIC x(32).
05 dmSpecVersion PIC 9(4) USAGE IS COMP-5.
05 dmDriverVersion PIC 9(4) USAGE IS COMP-5.
05 dmSize PIC 9(4) USAGE IS COMP-5.
05 dmDriverExtra PIC 9(4) USAGE IS COMP-5.
05 dmFields PIC 9(9) USAGE IS COMP-5.
05 dmOrientation PIC 9(4) USAGE IS COMP-5.
05 dmPaperSize PIC 9(4) USAGE IS COMP-5.
05 dmPaperLength PIC 9(4) USAGE IS COMP-5.
05 dmPaperWidth PIC 9(4) USAGE IS COMP-5.
05 dmScale PIC 9(4) USAGE IS COMP-5.
05 dmCopies PIC 9(4) USAGE IS COMP-5.
05 dmDefaultSource PIC 9(4) USAGE IS COMP-5.
05 dmPrintQuality PIC 9(4) USAGE IS COMP-5.
05 dmPosition.
10 Posx PIC 9(9) USAGE IS COMP-5.
10 Posy PIC 9(9) USAGE IS COMP-5.
05 dmDisplayOrientation PIC 9(9) USAGE IS COMP-5.
05 dmDisplayFixedOutput PIC 9(9) USAGE IS COMP-5.
05 dmColor PIC 9(4) USAGE IS COMP-5.
05 dmDuplex PIC 9(4) USAGE IS COMP-5.
05 dmYResolution PIC 9(4) USAGE IS COMP-5.
05 dmTTOption PIC 9(4) USAGE IS COMP-5.
05 dmCollate PIC 9(4) USAGE IS COMP-5.
05 dmFormName PIC 9(4) USAGE IS COMP-5.
05 dmLogPixels PIC 9(4) USAGE IS COMP-5.
05 dmBitsPerPel PIC 9(9) USAGE IS COMP-5.
05 dmPelsWidth PIC 9(9) USAGE IS COMP-5.
05 dmPelsHeight PIC 9(9) USAGE IS COMP-5.
05 dmDisplayFlags PIC 9(9) USAGE IS COMP-5.
05 dmNup PIC 9(9) USAGE IS COMP-5.
05 dmDisplayFrequency PIC 9(9) USAGE IS COMP-5.
05 dmICMMethod PIC 9(9) USAGE IS COMP-5.
05 dmICMIntent PIC 9(9) USAGE IS COMP-5.
05 dmMediaType PIC 9(9) USAGE IS COMP-5.
05 dmDitherType PIC 9(9) USAGE IS COMP-5.
05 dmReserved1 PIC 9(9) USAGE IS COMP-5.
05 dmReserved2 PIC 9(9) USAGE IS COMP-5.
05 dmPanningWidth PIC 9(9) USAGE IS COMP-5.
05 dmPanningHeight PIC 9(9) USAGE IS COMP-5.
More information about the structure:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_8nle.asp
Can anyone help me? :confused:
Thank you



