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