• 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.
  • Posts

    • I just want to know why the volume control feature in the browser version keeps appearing then disappearing, here today - gone tomorrow. Now it's gone again. Annoying as hell.
    • When you have only lies and blood libels to present, you've lost. And how hard is it for you to look up BBC and AP? You hate Jews, just admit it.
    • This article does not make sense and it’s very evident, the bug wasn’t confirmed to exist, because the application itself runs on editions of Windows which make it impossible to run Hyper-V VMs on, “Basically, Claude Desktop on Windows spins up a 1.8GB Hyper-V virtual machine if you use Claude Cowork or agent mode even once.”, suggests the bug is caused by something else otherwise it would only happen to users with the capability of running Hyper-V VMs and that’s only if Hyper-V was enabled which is by default not enabled. The true issue is that the author who reported the bug used the incorrect terminology, it’s actually a container, not a VM that is being started by the way. There were users on macOS reporting the same issue, Hyper-V, doesn’t exist on that platform obviously. Every single user who confirmed the problem in the last week was either using macOS making this issue impossible to be relevant to them, or was a comment talking about WSL, which the author indicated 3 months ago was disabled.
    • “To prevent hallucination issues and keep the database clean, the platform uses a multi-agent verification loop to check code quality.” - This absolutely isn’t happening. ”Before the massive rise of LLMs, which tanked its traffic by about 50% over the last couple of years, Stack Overflow was the go-to website for millions of programmers seeking coding solutions.” - It still is trusted, because the community of users, blocked other users from submitting false and misleading answers generated by AI agents that can be convinced something it generated is actually incorrect even if it’s actually correct. The company itself doesn’t know what it wants to be so it keeps trying and failing to introduce AI features to the platform. This effort will also fail, already submitted one successful poison pill, look forward to generating more.
  • Recent Achievements

    • One Month Later
      Sopa flores earned a badge
      One Month Later
    • First Post
      StaticMatrix earned a badge
      First Post
    • Week One Done
      StaticMatrix earned a badge
      Week One Done
    • Rookie
      lamborghiniv10 went up a rank
      Rookie
    • One Month Later
      pinnclepd earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      524
    2. 2
      PsYcHoKiLLa
      211
    3. 3
      +Edouard
      159
    4. 4
      Steven P.
      98
    5. 5
      ATLien_0
      83
  • Tell a friend

    Love Neowin? Tell a friend!