CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    Need Help on detected program?

    Hi all,

    I'm a beginer programming in C, C++.

    1st question:
    Would anyone help me on how to write a uitility that detects(read) Harddrive BIOS and
    returns the values such as size, cluster, sector, and track... The utility can run 16bits
    under MS-DOS when it boots from floppy???

    2nd question:
    Have anyone ever written a utility; it can detects(reads) the NIC's MAC address. If you did
    would you please let me know how it can be done??? It's also running under 16bits envnt.

    Thank you in advance for your help...

    Regards,
    Tona Lee


    "The future belongs to those who believe in
    the beauty of their dreams." ---Elennor Roosevelt.

  2. #2
    Join Date
    Jun 1999
    Posts
    5

    Re: Need Help on detected program?

    Hi Tona,

    I'm not sure I understood your 1st question right, but if so try e.g. for drive "c:":

    CString sDrive = _T( "C:\\" );
    DWORD dwSectorsPerCluster; // address of sectors per cluster
    DWORD dwBytesPerSector; // address of bytes per sector
    DWORD dwNumberOfFreeClusters; // address of number of free clusters
    DWORD dwTotalNumberOfClusters; // address of total number of clusters

    isOk = GetDiskFreeSpace(
    (LPCTSTR) sDrive,
    &dwSectorsPerCluster,
    &dwBytesPerSector,
    &dwNumberOfFreeClusters,
    &dwTotalNumberOfClusters );



    The _T( ) is neccesary for me because I have to fight with UNICODE (it's a hard fight).
    But it also works if you do not use UNICODE. The _T and also LPCTSTR are defines which are set to the corresponding function/type.

    Thomas Wollny


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured