• 0

EnumDisplayDevices wtg..


Question

Hi there, im currently making a dll for mIRC that will return my video card details, and am facing some problems.

The code below used to work when i had .net installed, however i formatted and have only put VC++ 6.0 on, and it

doesnt want to work for some reason.

It doesnt even get to the "test" part.

If anyone can shed some light on this, itd be much appreciated.

// --------- CODE ---------------------

DISPLAY_DEVICE dispdev;

dispdev.cb = sizeof(DISPLAY_DEVICE);

if (EnumDisplayDevices(NULL, 0, &dispdev, 0))

{

lstrcpy(data,"test");

} else {

lstrcpy(data,"Unable to obtain device");

}

return 3;

// --------- EOC -----------------------

Link to comment
https://www.neowin.net/forum/topic/69427-enumdisplaydevices-wtg/
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Well i actually updated the SDK before posting this, and I'm developing on XP.

In regards to when it worked, the actual dll worked

http://www.scripting-network.net/sirc/scri...ipt/SysInfo.zip

Infact I havent updated the dll on the site, so you can check it out there if you wish (there isnt any source), and you will need the .net framework, but it works.

Its just got me stumped, even the msdn cant help me :(

  • 0

Just curious to know how much have you tried to debug this. In times like this, I would have done the following to try and diagnose the problem...

  • Zero out dispdev (memset(&dispdev,NULL,sizeof(dispdev);) before setting cb. Place a watch on dispdev. Call EnumDisplayDevices. See if dispdev changed at all.
  • Write a very simple winmain EXE program that exercises EnumDisplayDevices (e.g. code from a book, a webpage, or your own design).
  • Add debug code (_RPT, TRACE, etc.) that spits out the contents of dispdev and the result of EnumDisplayDevices. Run it on another computer with DebugView running in the background. See if DebugView spits out the correct information.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.