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. get printer status............

get printer status............

Scheduled Pinned Locked Moved C / C++ / MFC
sysadmintutorialquestion
2 Posts 2 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.
  • A Offline
    A Offline
    ani_ikram
    wrote on last edited by
    #1

    before sending info for printing using CPrintDialog how to check whether selected printer(using printer dialog) is ready to print(attached to server) . i m using following code for printdialog call and getting selected printer name but unable to check status of selected print is there some method ??

    bool bNewDlg = true;
    // if no special printer-dialog is given, we take the standard printer-dialog
    if (m_printDlg == NULL)
    {
    m_printDlg = new CPrintDialog(FALSE,PD_DISABLEPRINTTOFILE);
    bNewDlg = false;
    }

    ASSERT(m\_printDlg != NULL);
    
    if (PrinterName == NULL) {
    
    	// which printer ist desired, and how much copies?
    	if (m\_printDlg->DoModal() == IDCANCEL) return (-1);
    	m\_hprinter = m\_printDlg->GetPrinterDC();
    
    	
    	
    	CString cs;
    cs= m\_printDlg->GetDeviceName();
     // AfxMessageBox(cs);
      m\_hprinter=m\_printDlg->GetPrinterDC();
    
      if(m\_hprinter==NULL)
    return;
    	m\_numCopies = m\_printDlg->GetCopies ();
    
    D 1 Reply Last reply
    0
    • A ani_ikram

      before sending info for printing using CPrintDialog how to check whether selected printer(using printer dialog) is ready to print(attached to server) . i m using following code for printdialog call and getting selected printer name but unable to check status of selected print is there some method ??

      bool bNewDlg = true;
      // if no special printer-dialog is given, we take the standard printer-dialog
      if (m_printDlg == NULL)
      {
      m_printDlg = new CPrintDialog(FALSE,PD_DISABLEPRINTTOFILE);
      bNewDlg = false;
      }

      ASSERT(m\_printDlg != NULL);
      
      if (PrinterName == NULL) {
      
      	// which printer ist desired, and how much copies?
      	if (m\_printDlg->DoModal() == IDCANCEL) return (-1);
      	m\_hprinter = m\_printDlg->GetPrinterDC();
      
      	
      	
      	CString cs;
      cs= m\_printDlg->GetDeviceName();
       // AfxMessageBox(cs);
        m\_hprinter=m\_printDlg->GetPrinterDC();
      
        if(m\_hprinter==NULL)
      return;
      	m\_numCopies = m\_printDlg->GetCopies ();
      
      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      What about calling GetPrinter(hPrinter, 2, ...)?

      "Love people and use things, not love things and use people." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      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