Thank you for the answer.
first,
set duplex in PRINT_MSG_SETUPEND event, definitely not works, can't change duplex (I try it many times)
if I set duplex in PRINT_MSG_SETUPSTART event, my printer works with VDUP_VERTICAL or VDUP_HORIZONTAL
but only when the Print-Dialog starts with a Duplex-Printer
anything else works, VpeSetDevDuplex() never returns false, the VpeGetDevice() returns the selected printer
I insert my test in your VpeDemo source ( only changed the color_table() proc. and the dupl. setting in windproc)
- Code: Select all
void color_table()
{
TCHAR mMsg[255];
VpeHandle hDoc = VpeOpenDoc(hMainWindow, "Test", VPE_NO_PAGESCROLLER );
// Open DOC and set VpeDevice to standard printer, (my standard printer has no duplex)
VpeSetPrintOptions(hDoc, PRINT_ALL + PRINT_NO_AUTO_PAGE_DIMS);
// I try with and without this, the same
myDuplex = VDUP_VERTICAL; // myDuplex is a global int variable
VpeGetDevice(hDoc,mMsg,64);
VpePrint(hDoc, 1 , 2, mMsg);
sprintf(mMsg, "Duplex: %d\n",VpeGetDevDuplex(hDoc));
VpePrint(hDoc, 1 , 4, mMsg);
VpePageBreak(hDoc);
VpePrint(hDoc, 1 , 4, "[ S 24 ]Page ... 2");
VpePreviewDoc(hDoc, NULL , VPE_SHOW_MAXIMIZED);
VpePrintDoc(hDoc,1);
// Print with Dialog, now I can change to my duplex Printer
// but the output is simple
};
// the event-handler
case VPE_PRINT:
switch (wParam)
{
case PRINT_MSG_SETUPABORT: // User aborted Setup-Dialog
// Msg("Caught event from VPE: Setup aborted.");
break;
case PRINT_MSG_SETUPSTART: // Setup-Dialog started
if ( !(VpeSetDevDuplex((VpeHandle)lParam, myDuplex))) Msg("duplex set false (in SETUPSTART)");
break;
case PRINT_MSG_SETUPEND: // Setup-Dialog ended
if (!(VpeSetDevDuplex((VpeHandle)lParam, myDuplex))) Msg("duplex set false (in SETUPEND)");
break;
case PRINT_MSG_START:
if (!(VpeSetDevDuplex((VpeHandle)lParam, myDuplex)) ) Msg("duplex set false (in START)");
break;
with the same result,
I try this also on my Win8 Laptop the same...
the Printer is Brother MFC-7460DN
Regards