Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. printer properties setting

printer properties setting

Scheduled Pinned Locked Moved C / C++ / MFC
help
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vgkotha
    wrote on last edited by
    #1

    hi i am wiritng my own print dialogbox. on that i place the controls for setting properties. i like to set that properties to selected printer. i wrote below code. but printer doesn't set the user selected properties . please correct the code where i am wrong. otherwise please give guidence Thank you void CmyPrintSetup::OnButPrint() { // TODO: Add your control notification handler code here unsigned char temp[32]; DEVMODE *devout,*devin; DWORD dwNeeded,dwRet; DEVMODE* pDevMode; if(!OpenPrinter(printername,&hprinter,NULL)) MessageBox("Printer can't be opened","error",MB_OK); dwNeeded=DocumentProperties(NULL,hprinter,printername,NULL,NULL,0); pDevMode=(DEVMODE*)malloc(dwNeeded); dwRet=DocumentProperties (NULL,hprinter,printername,pDevMode,NULL,DM_OUT_BUFFER); if (dwRet != IDOK) { /* If failure, cleanup and return failure. */ free(pDevMode); ClosePrinter(hprinter); } pDevMode->dmOrientation=m_orientation; pDevMode->dmCopies=m_copies; dwRet=DocumentProperties (NULL,hprinter,printername,pDevMode,pDevMode,DM_IN_BUFFER|DM_OUT_BUFFER); if(dwRet!=IDOK) { MessageBox("properties initialization error","error",MB_OK); } } please help it's urgent

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups