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. SetDefaultPrinter in WinSpool.h

SetDefaultPrinter in WinSpool.h

Scheduled Pinned Locked Moved C / C++ / MFC
helpcom
7 Posts 3 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.
  • J Offline
    J Offline
    Jaffer Mumtaz
    wrote on last edited by
    #1

    hi, I am working on an application to control the printers. I m getting a problem when i use SetDefaultPrinter in VC it gives me error of undeclared identifier i have included the header files. other function related to printers like OpenPrinter, GetPrinter etc r working fine but this one is not working can anybody help me out plzzz its urgent:(. take care contact me at Jaffer_mumtaz@yahoo.com

    J 1 Reply Last reply
    0
    • J Jaffer Mumtaz

      hi, I am working on an application to control the printers. I m getting a problem when i use SetDefaultPrinter in VC it gives me error of undeclared identifier i have included the header files. other function related to printers like OpenPrinter, GetPrinter etc r working fine but this one is not working can anybody help me out plzzz its urgent:(. take care contact me at Jaffer_mumtaz@yahoo.com

      J Offline
      J Offline
      Joel Lucsy
      wrote on last edited by
      #2

      It's a new functions only available on NT machines. In order for the compiler to see the function, you have to define WINVER to 0x500. Joel Lucsy

      J 1 Reply Last reply
      0
      • J Joel Lucsy

        It's a new functions only available on NT machines. In order for the compiler to see the function, you have to define WINVER to 0x500. Joel Lucsy

        J Offline
        J Offline
        Jaffer Mumtaz
        wrote on last edited by
        #3

        Hi Joel Thnx for replying early. I m working on windows 2000 plzz can u guide me a little more on it.I desperately need the function to work on my machine. what i need to do in the code inorder to use that code. take care

        J J 2 Replies Last reply
        0
        • J Jaffer Mumtaz

          Hi Joel Thnx for replying early. I m working on windows 2000 plzz can u guide me a little more on it.I desperately need the function to work on my machine. what i need to do in the code inorder to use that code. take care

          J Offline
          J Offline
          jhwurmbach
          wrote on last edited by
          #4

          You have to include < winspool.h > in the cpp-file where you use it, you have to link against winspool.lib, and you have to read MSDN! Its all in there!


          My opinions may have changed, but not the fact that I am right.

          1 Reply Last reply
          0
          • J Jaffer Mumtaz

            Hi Joel Thnx for replying early. I m working on windows 2000 plzz can u guide me a little more on it.I desperately need the function to work on my machine. what i need to do in the code inorder to use that code. take care

            J Offline
            J Offline
            Joel Lucsy
            wrote on last edited by
            #5

            put the line: #define WINVER 0x0500 in you stdafx.h before any #include's Joel Lucsy

            J 1 Reply Last reply
            0
            • J Joel Lucsy

              put the line: #define WINVER 0x0500 in you stdafx.h before any #include's Joel Lucsy

              J Offline
              J Offline
              Jaffer Mumtaz
              wrote on last edited by
              #6

              Hi joel I still get the same error undeclared identifier. as far as linking the the winspool.lib file plzz explain it a little more wht i have done is in the project settings of VC i have linked the winspool.lib file. take care One thing more when i chaged the version it gave the error then after some time it started working but with the same error. i m using win 2000 professional edition. any help will be appreciated alot

              J 1 Reply Last reply
              0
              • J Jaffer Mumtaz

                Hi joel I still get the same error undeclared identifier. as far as linking the the winspool.lib file plzz explain it a little more wht i have done is in the project settings of VC i have linked the winspool.lib file. take care One thing more when i chaged the version it gave the error then after some time it started working but with the same error. i m using win 2000 professional edition. any help will be appreciated alot

                J Offline
                J Offline
                Joel Lucsy
                wrote on last edited by
                #7

                You probably need to get the latest PlatformSDK from Microsoft. Joel Lucsy

                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