Objective Grid: Changing the default printer settings

Article ID: 45
Last updated: 16 Apr, 2018
Article ID: 45
Last updated: 16 Apr, 2018
Revision: 3
Views: 1837
Posted: 12 Jan, 2001
by Meltreger B.
Updated: 16 Apr, 2018
by Meltreger B.

Problem


How can I change the default printer settings?


Cause



Action


You need to get the device structures from the CGXPrintDevice object:

CGXPrintDevice* pDevice = GetPrintDevice( );

if (pDevice)
{

// Ensure that device info is existent
pDevice->NeedDeviceHandles( );

// Now, you can get the device info
LPDEVNAMES pDevNames;
DWORD cbSizeDevNames;
LPDEVMODE pDevMode;
DWORD cbSizeDevMode;

pd->GetDeviceInfo(pDevNames, cbSizeDevNames, pDevMode, cbSizeDevMode);

// Now, you can change this structure
// as documented in the Win31 SDK
// and later call CreateDeviceHandles
// to apply the changes.

pd->CreateDeviceHandles(pDevNames, cbSizeDevNames, pDevMode, cbSizeDevMode);

delete pDevMode;
delete pDevNames;

}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 45
Last updated: 16 Apr, 2018
Revision: 3
Views: 1837
Posted: 12 Jan, 2001 by Meltreger B.
Updated: 16 Apr, 2018 by Meltreger B.

Others in this category