• 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

    • Absolutely 👍
    • Exactly what I was thinking. All of a sudden in span of a month multiple CEO's from scam altman to this clown has had sudden change of heart does not seem organic change lol
    • Microsoft releases Visual Studio Code 1.124 with smarter autonomous AI agents by Paul Hill Microsoft has just released Visual Studio Code 1.124 with a focus on faster agent workflows and improved agent autonomy. Microsoft outlined the following features as the key items in this update: Autopilot: Autopilot, enabled by default, is now smarter to determine when a task is truly done. Background sessions: Quickly send a request in the background and keep composing the next session. Session navigation: Search, jump, and step through agent sessions with the keyboard. Browser history: Revisit and search pages you've already opened in the integrated browser. With VS Code 1.124, Microsoft has enabled Autopilot by default. For those that don’t know, Autopilot is a chat permission level that you can pick to give agents permission to take initiative and act autonomously, without needing explicit user approval for each action. Also related to Autopilot, Microsoft introduced Advanced Autopilot, which changes how Autopilot decides when to keep iterating and when to finish. This helps you get more complete results without manually monitoring loops. This feature works using a small utility model that reads a transcript of the chat and decides when the task is done. Another new feature in 1.124 is the Agents window, which lets you easily explore, iterate on, and review agent sessions across projects and machines. Previously, starting a new agent session meant waiting for it to load before you could compose the next one. With this update, sessions can be requested in the background. This VS Code update also brings session navigation updates to switch between them more quickly. The update also lets you reload or reopen the Agents window so that it no longer loses your layout, so you will land back where you left off. If you use the integrated browser in VS Code, you will notice that it now retains the history of visited pages. Suggestions will now show when typing in the URL bar and can be managed by using Ctrl+H within a browser tab. The browser now also lets you customize the toolbar more; just right-click on the toolbar area to the right of the URL input. Finally, the browser has faster agentic text entry. Another improvement is experimental enterprise-managed Copilot plugin policies that allow admins to centrally control which chat plugins and plugin marketplaces are available to developers. If you have VS Code installed, 1.124 should install automatically, or you'll get a prompt. If you don't have it installed, get it here.
  • Recent Achievements

    • First Post
      X-No-file earned a badge
      First Post
    • One Month Later
      johnjacobb40 earned a badge
      One Month Later
    • One Year In
      Primer1st earned a badge
      One Year In
    • Experienced
      JayZJay went up a rank
      Experienced
    • Reacting Well
      Sir_Timbit earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      513
    2. 2
      PsYcHoKiLLa
      218
    3. 3
      +Edouard
      145
    4. 4
      Steven P.
      87
    5. 5
      ATLien_0
      86
  • Tell a friend

    Love Neowin? Tell a friend!