c++visual-studio-2008printingvista64

Using PrintDlg on Vista x64 does not work, works fine on 32 bit and XP


We've got an app with some legacy printer "setup" code that we are still using PrintDlg for. We use a custom template to allow the user to select which printer to use for various types of printing tasks (such as reports or drawings) along with orientation and paper size/source.

It works on XP and 32-bit Vista, but on Vista x64 it gets a CDERR_MEMLOCKFAILURE via CommDlgExtendedError(). I've tried running it with just the bare-bones input in the PRINTDLG structure, but if the parameters include PD_PRINTSETUP or PD_RETURNDEFAULT, I get that error.

Since the printer selection / page setup has been split into PageSetupDlg and PrintDlgEx, there is no apparent easy transition without changing a fair amount of code and/or changing completely how we present printing and printer setup to the user.

Has anyone seen this problem on 64-bit Vista, and have you found any work-arounds?

Notes:
Application runs as Administrator due to other constraints


Solution

  • I found a related post on the Microsoft forums: On Vista x64, DocumentProperties fails from UAC-elevated process

    I've verified with a sample program that PrintDlg running as non-admin works.