Article | 60001382 |
Type | Wish |
Product | Engine |
Version | 6019 |
Date Added | 4/21/2011 |
Fixed | Yes [4/27/2011] |
Submitted by | dainius ceponis |
Keywords |
In version 6020 a new methods was added.
1.GetDevMode
Returns a pointer to a global movable memory that reference to a WIN32 DEVMODEW data structure contains information about the initialization and environment of selected printer.
It works only on Windows NT, Windows 2000, Windows XP, and the Windows Server 2003 platforms.
The return structure represents the Unicode Version DEVMODEW2. DevNames
Returns a pointer to a global movable memory that reference to a WIN32 DEVNAMESW data structure contains strings that identify the driver, device, and output port names for a printer. It works only on Windows NT, Windows 2000, Windows XP, and the Windows Server 2003 platforms. The return structure represents the Unicode Version DEVNAMESW3. SelectPrinterDeviceDefaults(
int hDevNames, int hDevMode) Change the selected printer properties passing pointers to a global movable memory that reference to a WIN32 DEVNAMESW and DEVMODEW data structure. hDevNames represents a global movable memory that reference to a WIN32 DEVNAMESW UNICODE version structure.</param>hDevMode represents a global movable memory that reference to a WIN32 DEVMODEW UNICODE version structure.</param>
It works only on Windows NT, Windows 2000, Windows XP, and the Windows Server 2003 platforms.Example in VC++ 6 :
//Description
//We use the default VectorDraw printer method PrinterSetup to select a printer and its properties.
//Then we get the DEVNAMES and DEVMODE for the selected printer and pass these values to a WIN32 API PRINTDLG
//We change the printer properties using the WIN32 API PrintDlg method
//and we passed the changes back to VectorDraw Printer.
//finally we print out the document to the selected printer device.
CvdPrint print = m_draw.GetActiveDocument().GetPrinter();
print.PrinterSetup();
long hDevMode = print.GetDevMode();
long hDevNames = print.GetDevNames();
PRINTDLGW pd;
// Initialize PRINTDLG
ZeroMemory(&pd, sizeof(pd));
pd.lStructSize = sizeof(pd);
pd.hwndOwner = this->GetSafeHwnd();
pd.hDevMode = (HANDLE)hDevMode; // Don't forget to free or store hDevMode.
pd.hDevNames = (HANDLE)hDevNames; // Don't forget to free or store hDevNames.
pd.Flags = PD_PRINTSETUP;
pd.nCopies = 1;
pd.nFromPage = 0xFFFF;
pd.nToPage = 0xFFFF;
pd.nMinPage = 1;
pd.nMaxPage = 0xFFFF;
if (IDOK != ::PrintDlgW(&pd))
{
return;
}
print.SelectPrinterDeviceDefaults((long)pd.hDevNames,(long)pd.hDevMode);
::GlobalFree(pd.hDevNames);
::GlobalFree(pd.hDevMode);
print.PrintExtends();
print.PrintScaleToFit();
print.PrintOut();