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. problem with EnumDisplayDevices(..)

problem with EnumDisplayDevices(..)

Scheduled Pinned Locked Moved C / C++ / MFC
help
9 Posts 3 Posters 1 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
    Anonymous
    wrote on last edited by
    #1

    hii, for any call of this function EnumDisplayDevices(..) , It generate error when compilation , "undeclared identifier" without any acceptable reason !! any one can help of that , - I made all needed includes ! , hatem

    R 1 Reply Last reply
    0
    • A Anonymous

      hii, for any call of this function EnumDisplayDevices(..) , It generate error when compilation , "undeclared identifier" without any acceptable reason !! any one can help of that , - I made all needed includes ! , hatem

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      #include <multimon.h> In one (and only one) file that includes this file, include this line before the #include line: #define COMPILE_MULTIMON_STUBS This will enable the use of the multi-monitor functions on any platform (even though Win95 does not support multiple monitors) and degrade gracefully if they are not supported. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
      Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

      H 1 Reply Last reply
      0
      • R Ryan Binns

        #include <multimon.h> In one (and only one) file that includes this file, include this line before the #include line: #define COMPILE_MULTIMON_STUBS This will enable the use of the multi-monitor functions on any platform (even though Win95 does not support multiple monitors) and degrade gracefully if they are not supported. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
        Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

        H Offline
        H Offline
        Hatem Darweesh
        wrote on last edited by
        #3

        thank you.. .. but :( nothing changed ! , still "undeclared indentifier" with .. #include #include #define COMPILE_MULTIMON_STUBS void main() { DISPLAY_DEVICE dd; EnumDisplayDevices(0, 0, &dd, 0); } and , "unresolved external symbol __imp__EnumDisplayDevicesA@16" with .. #define WINVER 0x0500 #include #include #define COMPILE_MULTIMON_STUBS void main() { DISPLAY_DEVICE dd; EnumDisplayDevices(0, 0, &dd, 0); } and if I repaced the windows.h & multimon.h it make 29 error !!! I eally disappointed !!

        R 1 Reply Last reply
        0
        • H Hatem Darweesh

          thank you.. .. but :( nothing changed ! , still "undeclared indentifier" with .. #include #include #define COMPILE_MULTIMON_STUBS void main() { DISPLAY_DEVICE dd; EnumDisplayDevices(0, 0, &dd, 0); } and , "unresolved external symbol __imp__EnumDisplayDevicesA@16" with .. #define WINVER 0x0500 #include #include #define COMPILE_MULTIMON_STUBS void main() { DISPLAY_DEVICE dd; EnumDisplayDevices(0, 0, &dd, 0); } and if I repaced the windows.h & multimon.h it make 29 error !!! I eally disappointed !!

          R Offline
          R Offline
          Ryan Binns
          wrote on last edited by
          #4

          I said to place the #define COMPILE_MULTIMON_STUBS line BEFORE the #include <multimon.h> line, not after. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
          Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

          H 1 Reply Last reply
          0
          • R Ryan Binns

            I said to place the #define COMPILE_MULTIMON_STUBS line BEFORE the #include <multimon.h> line, not after. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
            Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

            H Offline
            H Offline
            Hatem Darweesh
            wrote on last edited by
            #5

            I did , nothing happened !! the same error , I want to tell u that I seached in User32.lib , I find all enum function , but EnumDisplayDevices does not exit at all !!! , I MSDN they say that this function exists in User32.LIB !! , I wonder if there is another function , instead of this unexist one !! hatem

            R 1 Reply Last reply
            0
            • H Hatem Darweesh

              I did , nothing happened !! the same error , I want to tell u that I seached in User32.lib , I find all enum function , but EnumDisplayDevices does not exit at all !!! , I MSDN they say that this function exists in User32.LIB !! , I wonder if there is another function , instead of this unexist one !! hatem

              R Offline
              R Offline
              Ryan Binns
              wrote on last edited by
              #6

              The code that you posted has the #define line after the #include line, so I assumed that this was the code you were testing. The function works perfectly. I have used it plenty of times before. Try this:

              #include <windows.h>
              #define COMPILE_MULTIMON_STUBS
              #include <multimon.h>

              int WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
              {
              DISPLAY_DEVICE dd;
              dd.cb = sizeof(DISPLAY_DEVICE);
              for(int i=0; EnumDisplayDevices(NULL, i, &dd, 0); i++)
              {
              // Do whatever with the data here
              }
              return 0;
              }

              Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
              Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

              H 1 Reply Last reply
              0
              • R Ryan Binns

                The code that you posted has the #define line after the #include line, so I assumed that this was the code you were testing. The function works perfectly. I have used it plenty of times before. Try this:

                #include <windows.h>
                #define COMPILE_MULTIMON_STUBS
                #include <multimon.h>

                int WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
                {
                DISPLAY_DEVICE dd;
                dd.cb = sizeof(DISPLAY_DEVICE);
                for(int i=0; EnumDisplayDevices(NULL, i, &dd, 0); i++)
                {
                // Do whatever with the data here
                }
                return 0;
                }

                Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
                Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

                H Offline
                H Offline
                Hatem Darweesh
                wrote on last edited by
                #7

                sorry , but I tryed your code , and the same problem occures , !! , I think it may be the problem of Windows2000 , or some thing wrong with my VC++ !! , hatem

                A R 2 Replies Last reply
                0
                • H Hatem Darweesh

                  sorry , but I tryed your code , and the same problem occures , !! , I think it may be the problem of Windows2000 , or some thing wrong with my VC++ !! , hatem

                  A Offline
                  A Offline
                  Anonymous
                  wrote on last edited by
                  #8

                  please could u send me a sample application , that this function is work in it , my mail is , hatem_poet@menanet.net

                  1 Reply Last reply
                  0
                  • H Hatem Darweesh

                    sorry , but I tryed your code , and the same problem occures , !! , I think it may be the problem of Windows2000 , or some thing wrong with my VC++ !! , hatem

                    R Offline
                    R Offline
                    Ryan Binns
                    wrote on last edited by
                    #9

                    There's something wrong with what you're doing. I compiled exactly the code that I posted before, and it compiled with only one warning, which could be safely ignored. Sorry, I can't help any more than this. I don't know what you're doing wrong. You'll have to sort it out there. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
                    Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

                    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