views:

90

answers:

1

How do you do it? This page says you need to call PrintSetupDlg, but this code

PAGESETUPDLG printDialog;
ZeroMemory(&printDialog, sizeof(printDialog));
printDialog.lStructSize = sizeof(printDialog);
printDialog.hwndOwner = hwnd; //or = NULL

PageSetupDlg(&printDialog);

freezes the program on the call to PageSetupDlg - it becomes unresponsive, and I need to stop the process.

How do I print in Windows CE? (using C++ in a DirectX app, CE 6.0)

+1  A: 

Turns out that, for some crazy reason, dialog boxes only get drawn to the original front buffer, even if that buffer has been swapped and the original back buffer is now the front buffer (being shown on the screen).

The solution was to keep track of how many times the buffer has been swapped, and swap it again if the number of swaps was odd (which causes the original front buffer to always be the current front-buffer when the dialog is shown).

BlueRaja - Danny Pflughoeft