Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
#include "stdafx.h"
 #define WINVER 0x0500
#include <stdio.h>

#include <windows.h>
#include <conio.h>

int main(int argc, char* argv[])
{
    DEVMODE  dev;
     DWORD           DispNum = 0;
    DISPLAY_DEVICE  DisplayDevice;
    ZeroMemory(&DisplayDevice,sizeof(DisplayDevice));
EnumDisplayDevices(NULL, DispNum, &DisplayDevice, 0);

    return 0;
}



this is my coding ..

first it gives error in EnumDisplayDevices is undeclared ..
Then i included #define WINVER 0x0500.
the problem is solved.. But now it gives some other compilie time errors..

Error:

CSS
Compiling...
disp.cpp
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications.  To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
D:\Users\Dharmaraj\pratice\disp\disp.cpp(13) : warning C4101: 'dev' : unreferenced local variable
Linking...
disp.obj : error LNK2001: unresolved external symbol __imp__EnumDisplayDevicesA@16
Debug/disp.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.





my self i increase the #define WINVER 0x0600 like that.. then also same error..

how to solve this one..

senior please help me..
Posted
Comments
cariolihome 17-Oct-11 3:03am    
Did You include user32.lib to the project ?
@BangIndia 17-Oct-11 3:53am    
Yes.. i included ..

It looks like you are using an old Windows SDK. Download the latest one from MSDN.
 
Share this answer
 
Check this out

http://msdn.microsoft.com/en-us/library/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900