strFree.Format(_T("%ld"), m_nFree);
CString strPerUsed;
- strPerUsed.Format(_T("%d"), ((m_nSize - m_nFree) * 100) / m_nSize);
+ strPerUsed.Format(_T("%d"), ((m_nSize - m_nFree) / m_nSize) * 100);
m_Size.SetWindowText(strSize);
m_Free.SetWindowText(strFree);
- percentUsed = ( double(m_nSize - m_nFree) * 100.0l ) / double(m_nSize);
+ percentUsed = ( double(m_nSize - m_nFree) / double(m_nSize) * 100.0l);
strPerUsed.Format(_T("%2.2lf"), percentUsed );
return TRUE; // return TRUE unless you set the focus to a control
CString m_strFilePath;
CString m_strFileName;
CString m_strName;
- LONG m_nID;
- LONG m_nQuota;
- LONG m_nNewQuota;
- LONG m_nUsed;
- LONG m_nPartSize;
- LONG m_nPartFree;
+ unsigned __int64 m_nID;
+ unsigned __int64 m_nQuota;
+ unsigned __int64 m_nNewQuota;
+ unsigned __int64 m_nUsed;
+ unsigned __int64 m_nPartSize;
+ unsigned __int64 m_nPartFree;
int m_nDup;
CString m_strErrorMsg;
};
CButton m_Ok;
CButton m_ShowPartInfo;
CListBox m_List;
- long m_nNewQuota;
+ unsigned __int64 m_nNewQuota;
//}}AFX_DATA
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
- LONG nNewQuota = m_nNewQuota + pNMUpDown->iDelta * 1024;
+ unsigned __int64 nNewQuota = m_nNewQuota + pNMUpDown->iDelta * 1024;
if (nNewQuota < 0)
return;
strEntry = m_pVolInfo[i].m_strFileName + "\t(Error: " + m_pVolInfo[i].m_strErrorMsg + ")";
else {
- LONG nQuota;
+ unsigned __int64 nQuota;
if (m_pVolInfo[i].m_nDup == -1)
nQuota = m_pVolInfo[i].m_nNewQuota;
else
nQuota = m_pVolInfo[m_pVolInfo[i].m_nDup].m_nNewQuota;
if (nQuota != 0) {
- LONG nPercentUsed = (m_pVolInfo[i].m_nUsed * 100) / nQuota;
+ LONG nPercentUsed = (LONG)((double)m_pVolInfo[i].m_nUsed / nQuota * 100);
strEntry.Format(_T("%s\t%s\t%ld\t%ldK\t%ldK\t%ld%%"),
m_pVolInfo[i].m_strFileName,
m_pVolInfo[i].m_strName,