473,790 Members | 3,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to read EDID directly from the monitor.

I am having this issue with both Visual C++ 6.0 and Visual Studio 2005 Beta
2. I have the SDK and DDK installed. I am trying to write a program to
retrieve the EDID for a specific monitor in a multi-monitor system. I
already know how to get this information from the registry, but I wish to get
the EDID from the monitor directly.

So far I have been unable to compile my program. The compiler generates
over 102 errors and 54 warnings, all of which seem to be from header files.
Below is a section of the code containing the two mentioned functions as well
as a sample of the error messages recieved from the build attempt.

I have included the headers ntddk.h and video.h and linked to the libraries
ntoskrnl.exe, wdm.lib, wdmsec.lib, and videoprt.lib. I believe my problems
stem from one or more of these.

There are two functions that I am using that require these headers/libraries:
1. IoGetDeviceObje ctPointer
(http://msdn.microsoft.com/library/de...2c3471.xml.asp)

2. VideoPortDDCMon itorHelper
(http://msdn.microsoft.com/library/de...9be157.xml.asp)

Why won't it recognize the headers properly? Any thoughts on what is
causing these errors? Am I using the wrong headers, linking the wrong
libraries? Is there an easier way to do this?

Thank you for your time.
Code sample:
/* get device object name */
if (SetupDiGetDevi ceRegistryPrope rty( //PDO
devInfoSet,
&devInfoData ,
SPDRP_PHYSICAL_ DEVICE_OBJECT_N AME,
NULL,
(PBYTE)(&PDO),
sizeof(PDO),
NULL))
{
fprintf_s(stdou t, " PDO = %s\n", PDO);
sprintf_s(temp, sizeof(temp), " PDO = %s\n", PDO);
strcat_s(log, sizeof(log), temp);

/* get device object pointer */
if (IoGetDeviceObj ectPointer(&PDO , FILE_READ_DATA, &fileObject,
&deviceObjec t)) {
fprintf_s(stdou t, " Device object pointer obtained.\n");
strcat_s(log, sizeof(log), " Device object pointer obtained.\n");

/* get device extension pointer */
HwDeviceExtensi on = VideoPortGetAss ociatedDeviceEx tension(&device Object)
if (HwDeviceExtens ion != NULL) {
fprintf_s(stdou t, " Device extension obtained.\n", PDO);
strcat_s(log, sizeof(log), " Device extension obtained.\n", PDO);

if (VideoPortDDCMo nitorHelper(HwD eviceExtension, &DDCControl,
EDIDdata, sizeof(EDIDdata ))) {
sprintf_s(regMa nID, sizeof(regManID ), "");
sprintf_s(regPr oID, sizeof(regProID ), "");
sprintf_s(regSe rialA, sizeof(regSeria lA), "");
sprintf_s(regSe rialB, sizeof(regSeria lB), "");
sprintf_s(regNa me, sizeof(regName) , "");
fprintf_s(stdou t, "\n EDID information\n") ;
strcat_s(log, sizeof(log), "\n EDID information\n") ;
for (i=8; i < 10; i++) { //Manufacturer ID (08h-09h)
sprintf_s(temp, sizeof(temp), "%02X ", EDIDdata);
strcat_s(regMan ID, sizeof(regManID ), temp);
}

fprintf_s(stdou t, " Manufacturer ID (hex) = %s \n", regManID);
sprintf_s(temp, sizeof(temp), " Manufacturer ID (hex) = %s \n",
regManID);
strcat_s(log, sizeof(log), temp);
}
}
}
}

Build output sample:
1>------ Build started: Project: loadLUT, Configuration: Debug Win32 ------

1>Compiling...

1>loadLUT.cpp

1>c:\winddk\260 0.1106\inc\wxp\ ntdef.h(81) : warning C4005:
'MAX_NATURAL_AL IGNMENT' : macro redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsd k\include\winnt .h(53) : see previous definition of
'MAX_NATURAL_AL IGNMENT'

1>c:\winddk\260 0.1106\inc\wxp\ ntdef.h(108) : warning C4005:
'PROBE_ALIGNMEN T' : macro redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsd k\include\winnt .h(86) : see previous definition of
'PROBE_ALIGNMEN T'

1>c:\winddk\260 0.1106\inc\wxp\ ntdef.h(134) : warning C4005: 'POINTER_64' :
macro redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsd k\include\baset sd.h(36) : see previous definition of
'POINTER_64'

(SECTION ABBREVIATED)

1> c:\program files\microsoft visual studio
8\vc\platformsd k\include\winnt .h(2934) : see declaration of
'_FLOATING_SAVE _AREA'

1>c:\winddk\260 0.1106\inc\ddk\ wxp\ntddk.h(627 ) : error C2011: '_CONTEXT' :
'struct' type redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsd k\include\winnt .h(2958) : see declaration of '_CONTEXT'

1>c:\winddk\260 0.1106\inc\ddk\ wxp\ntddk.h(155 1) : error C2011:
'_GENERIC_MAPPI NG' : 'struct' type redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsd k\include\winnt .h(3951) : see declaration of '_GENERIC_MAPPI NG'

1>c:\winddk\260 0.1106\inc\ddk\ wxp\ntddk.h(157 2) : error C2011:
'_LUID_AND_ATTR IBUTES' : 'struct' type redefinition

(SECTION ABBREVIATED)

1>c:\winddk\260 0.1106\inc\ddk\ wxp\ntddk.h(294 1) : fatal error C1003: error
count exceeds 100; stopping compilation

1>Build log was saved at
"file://c:\PMT\loadLUT2-1\_loadLUT\load LUT\Debug\Build Log.htm"

1>loadLUT - 102 error(s), 54 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Nov 17 '05 #1
0 7013

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2093
by: Rich Grise | last post by:
I think I've finally found a tutorial that can get me started: http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html and I've been lurking for awhile as well. What happened is, I've been playing with Qt in KDE on a Slackware 10.0 system, and following their cookbook exercises, and everything's working, and I have no clue what the code is doing, i.e.. how do I connect my brain to the ascii in the files to the stuff on...
4
2667
by: Jeff Rodriguez | last post by:
Main just loops over this while it's not null. The segfault occurs at this line: *line = (char)ch; Also, please don't just fix the code. I would like to know why exactly this isn't working so I can avoid problems with it in the future. If there are any references I should check out let me know. Full highlighted code at:
0
1802
by: Robert | last post by:
After failing on a yield/iterator-continuation problem in Python (see below) I tried the Ruby (1.8.2) language first time on that construct: The example tries to convert a block callback interface (Net::FTP.retrbinary) into a read()-like iterator function in order to virtualize the existing FTP class as kind of file system. 4 bytes max per read in this first simple test below. But it fails on the second continuation with ThreadError after...
62
3456
by: Bryan Dickerson | last post by:
Is there a way, with VS 2005 and FX 2.0, to read a given inbox? I need to write a 'monitor' program and my boss is convinced, as is always his first gut reaction, that we need to go buy a 3rd-party package to just read an inbox. He may be right this time, but that's not usually my first gut reaction--we've had too many good employees around here fired 'cause they spent too much money on albatross software (another soapbox, sorry). I need...
0
1441
by: Kristian Frost | last post by:
Hi, I'm just getting started with VB.Net, and I'm having trouble getting the routing around of some of the data straight in my mind, which has led me to the following problem. Basically, I'm trying to create an object that will monitor the status of some switches. I created a User Control to put into a form, on which I want to have five graphical representations of LEDs, which I've got working, light up and turn off when the...
7
13407
by: =?Utf-8?B?Sm9obi5ORVQ=?= | last post by:
Hi I have written a windows service in C# / .NET I have installed it and it's working fine on a couple boxes but on my XP box I get this error when I try to start it: Error 1053: The service did not respond to the start or control request in a timely fashion. I understand that the scm issue the start and is supposed to put up this error after some timeout period but it's coming up after only about half a second and it doesnt even...
23
3007
by: asit dhal | last post by:
hello friends, can anyone explain me how to use read() write() function in C. and also how to read a file from disk and show it on the monitor using onlu read(), write() function ??????
4
5932
by: buu | last post by:
so, I have a private object as system.threading.AutoResetEvent, and I would like to read it's current status. currently I have an another boolean object wich I update together with an AutoResetEvent, but I don't think it's the best practice....
0
1284
by: lordfallout | last post by:
Is this possible? What I need is, to monitor the files of a virtual machine in real-time to check which VM is slowing down the system. I've researched for a program that can monitor the VM's directly but haven't found any. Now I'm stuck to programming one. And I think it's easier to monitor it's files instead of monitoring directly each VM. Any help to a freeware program or a start is appreciated. I only have basic knowledge in VB using...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10201
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9023
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.