CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Need serious help: how to detect if a printer is connected or not

    Print gurus,

    Lets try this again: How do I detect if a printer is connected or not. Already tried OpenPrinter() and GetPrinter() and both cannot detect if a printer is connected or not. Somebody point me to the right direction pls.

    Sincerely,
    Ted


  2. #2
    Join Date
    Apr 1999
    Location
    VA BEACH
    Posts
    467

    Re: Need serious help: how to detect if a printer is connected or not

    here is some code

    CPrintDialog dlg(true); // get default printer setup
    dlg.GetDefaults();
    DEVMODEA *pDevModeStruct = dlg.GetDevMode();
    if( !pDevModeStruct )//if no devmode
    EndDialog(0);//no printer setup



    that will tell if there is a connected pritner





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured