dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Problem with getting hard disk values

  1. #1
    Join Date
    Feb 2007
    Posts
    258

    Problem with getting hard disk values

    Hi all,

    i am using wmi for getting hard disk values...

    SELECT * FROM Win32_DiskDrive

    Now i am getting value in hard disk model name like this

    <pre>
    hr = pclsObj->Get(L"Model", 0, &amp;vtProp, 0, 0);
    AfxMessageBox(vtProp.bstrVal);
    </pre>

    also number of cylinders is also coming using this coding

    <pre>
    hr = pclsObj->Get(L"TotalCylinders", 0, &amp;vtProp, 0, 0);
    AfxMessageBox(vtProp.bstrVal);
    </pre>

    Now my problem is i am not getting value for Total Heads
    its printing blank
    <pre>
    hr = pclsObj-&gt;Get(L"TotalHeads", 0, &amp;vtProp, 0, 0);
    AfxMessageBox(vtProp.bstrVal);
    </pre>

    <pre>
    hr = pclsObj-&gt;Get(L"TotalHeads", 0, &amp;vtProp, 0, 0);
    AfxMessageBox(vtProp.bstrVal);
    </pre>
    in total heads value i am getting
    156296385

    I am not getting how to resolve it....

    what method i should use to get values???

  2. #2
    Join Date
    Jan 2008
    Posts
    178

    Re: Problem with getting hard disk values

    Don't use WMI.
    Use standard win32 api

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)