Hello,
I suppose that the Sql Server team who has developped the method EnumAvailableMedia() has foreseen the possiblity of very,very large media, but i don't understand why they have not used Int64 which may contain upto 9 * ( 10 power 17 ).
In VC#, you should have a code like :
Code Snippet
Int64 lowfree64 = Convert.ToInt64(lowfree);
Int64 highfree64 = Convert.ToInt64(highfree * Math.Pow(2,32));
Int64 tempres64 = (highfree64 + lowfree64) / (1024*1024);
In tempres64, you should have your result in MB.
But , be careful, with all the conversions, i think that an error of 2 MB is possible ...)
A quicker solution is possible, if you post on VB/VC#/.Net Framework forums, maybe someone woumd be able to provide you a quicker solution.
As i prefer VC#, i have posted in VC#.
If you prefer VB, i may post this code in VB
Have a nice day