1

I would like to get the display adapter card memory size. What is the best way to do this?

My development enviroment is Visual Studio C++ 2008.

Thanks.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
eric
  • 143
  • 6
  • 18
  • 1
    @Cody: now that's a good way of saying it. I'm really getting tired of people essentially *threatening* newcomers that "NO ONE WILL ANSWER YOUR QUESTIONS IF YOU DONT ACCEPT SOMETHING". So +1 to you for not doing that. ;) – jalf Dec 13 '10 at 07:45
  • Sometimes I don't put a check because multiple people have answered well, and I feel like I'd be offending someone if I picked one over the other, so I try to keep my eye on them and click it sooner than people start stacking posts – oldSkool Dec 13 '10 at 10:09
  • 2
    @old-school: SO etiquette is to accept one of the answers still, in that case. You won't offend anyone, so just pick the one you prefer: the one that is more readable, detailed or whatever other criteria you prefer. However, if you feel that no answer is really "good enough", don't accept any. – jalf Dec 13 '10 at 14:56
  • @old-school: The only thing I have to add to jalf's comment is that you can always *upvote* as many answers as you want, even if you only accept one. Generally, as he says, you'll accept the best answer (however you decide), but upvote all of the answers that you found helpful or useful. – Cody Gray - on strike Dec 14 '10 at 03:38

2 Answers2

2

One of the (easier and uniform) ways of getting this is through WMI or windows management instrumentation.

E.g. to view it non programatically through WMI.
1. Open Run > wbemtest > press enter. This will bring up the WMI window.
2. Click Connect > enter root\cimv2 into the box that has already root\default > push Connect.
3. Click on Query > Enter query as Select * from Win32_VideoController > Apply > double click the value returned. This will bring up a window with information about your graphics card.
4. In the object editor window check the field AdapterRam which has the graphics card RAM in bytes.

Now to programatically do this in VC++, you need to access APIs of the WMI provider. You'll find an example here.

Hope that helps.

Samrat Patil
  • 788
  • 5
  • 23
0

Consider the graphics library you are using... the difficulty of determining the installed video memory will depend on the library. Some libraries do not provide methods for this. Perhaps the easiest library to get the installed video memory is SDL...

http://www.libsdl.org/cgi/docwiki.cgi/SDL_VideoInfo

oldSkool
  • 1,212
  • 5
  • 14
  • 29