• 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

    • The problem of course is simply that government does not always know best. My point is that agency is taken away from the EU consumer in these cases. I'm sorry, but I do not believe that governments (politicians) are inherently good, and "looking out for me." Primarily they look to themselves and their own personal desires first, foremost, and always. When the EU or the DOJ fines these companies, claiming to "represent the welfare of the consumer," how much of these billion-dollar judgments are handed to the consumers they claim to represent? Not even a dollar, as I've seen. Yet the EUC lawyers who are paid to sit around and dream up these suits make huge commissions on the fines the EUC adjudicates, which is an ironclad fact I hope everyone is aware of. It's also rank corruption, of course, but that's another topic. Last, when the EU inflicts these judgments, or the DOJ, take your pick, the costs are bundled right along in the cost of the goods and services these companies provide the consumers they are "looking out for." If you are someone who believes his government is his savior then you have my condolences. I think Apple is right here, because the whole scheme of consumer choice is that consumers pick and choose among the products companies offer. Microsoft Windows is more compatible with third party software and hardware than any desktop OS on Earth, which is my sole reason for choosing it. Just because the EUC forces companies do certain things it knows the companies do not want to do, "or else", has no bearing on consumer benefit. This Siri thing is almost idiotic it's so infantile. But this is what the EUC does when the EU in Brussels becomes cash-strapped and needs a big infusion of cash. Some people get upset by "big companies" but it's the opposite when governments dwarf the size and scope of these companies, which is so obvious it hurts.... I mean you can't honestly believe that forcing Apple to do things with Siri it has its own reasons to decline is something that "opens up" Apple, do you? Say it aint' so...
    • Looks like many years since the request was made, a directory tree view finally may be added. https://github.com/files-community/Files/pull/18537
    • There's this from last year https://gist.github.com/threat...364659a8887841aa43deca4efd9 but nothing about a buffer overflow that MS somehow can't code against. No matter what, it makes sense to take a "protected by default" approach.
  • Recent Achievements

    • One Month Later
      sjbousquet earned a badge
      One Month Later
    • Week One Done
      sjbousquet earned a badge
      Week One Done
    • First Post
      DragonOfMercy earned a badge
      First Post
    • First Post
      bella52 earned a badge
      First Post
    • Reacting Well
      Techinmay earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      PsYcHoKiLLa
      214
    3. 3
      +Edouard
      156
    4. 4
      Steven P.
      84
    5. 5
      FloatingFatMan
      72
  • Tell a friend

    Love Neowin? Tell a friend!