Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Driver Installation Issue Pin
Erudite_Eric15-Mar-12 21:50
Erudite_Eric15-Mar-12 21:50 
GeneralRe: Driver Installation Issue Pin
rupeshkp72815-Mar-12 21:57
rupeshkp72815-Mar-12 21:57 
GeneralRe: Driver Installation Issue Pin
Erudite_Eric16-Mar-12 10:12
Erudite_Eric16-Mar-12 10:12 
QuestionQuestion about smart pointers in C++ Pin
supermoore102515-Mar-12 19:52
supermoore102515-Mar-12 19:52 
AnswerRe: Question about smart pointers in C++ Pin
_AnsHUMAN_ 15-Mar-12 20:25
_AnsHUMAN_ 15-Mar-12 20:25 
AnswerRe: Question about smart pointers in C++ Pin
Erudite_Eric15-Mar-12 22:07
Erudite_Eric15-Mar-12 22:07 
Questionc++, easy way to format filesize from Large Integer to KB, MB, GB Pin
jkirkerx15-Mar-12 10:55
professionaljkirkerx15-Mar-12 10:55 
AnswerRe: c++, easy way to format filesize from Large Integer to KB, MB, GB Pin
enhzflep15-Mar-12 14:49
enhzflep15-Mar-12 14:49 
I don't think there's any function that's already made for the task, though it is very simple - a couple of lines in fact.

Here's some code I have in an app:

C++
case WM_FILE_DOWNLOAD_PROGRESS_AVAILABLE:
    progHdr = (downloadHeader_t*)lParam;

    if (progHdr->bComplete)
        sprintf(buffer, "Complete");
    else
    {
        if (progHdr->contentLen > 1024*1024)
            sprintf(buffer, "%.2f MB", (float)progHdr->contentLen / (1024*1024) );
        else if (progHdr->contentLen > 1024)
            sprintf(buffer, "%.1f KB", (float)progHdr->contentLen / (1024) );
        else
            sprintf(buffer, "%d B", progHdr->contentLen);
    }

    setListViewItemDownloaded(listWnd, (int)progHdr->lParam, buffer);

    return true;

GeneralRe: c++, easy way to format filesize from Large Integer to KB, MB, GB Pin
Chuck O'Toole16-Mar-12 14:48
Chuck O'Toole16-Mar-12 14:48 
GeneralRe: c++, easy way to format filesize from Large Integer to KB, MB, GB Pin
enhzflep16-Mar-12 17:25
enhzflep16-Mar-12 17:25 
GeneralRe: c++, easy way to format filesize from Large Integer to KB, MB, GB Pin
jkirkerx18-Mar-12 17:06
professionaljkirkerx18-Mar-12 17:06 
AnswerRe: c++, easy way to format filesize from Large Integer to KB, MB, GB Pin
jschell16-Mar-12 11:39
jschell16-Mar-12 11:39 
QuestionDialog based on JPG advise Pin
Codling202015-Mar-12 6:32
Codling202015-Mar-12 6:32 
AnswerRe: Dialog based on JPG advise Pin
Richard MacCutchan15-Mar-12 6:59
mveRichard MacCutchan15-Mar-12 6:59 
AnswerRe: Dialog based on JPG advise Pin
_AnsHUMAN_ 15-Mar-12 18:36
_AnsHUMAN_ 15-Mar-12 18:36 
Questionneed small c++ projects with documentation Pin
johan david15-Mar-12 4:21
johan david15-Mar-12 4:21 
AnswerRe: need small c++ projects with documentation Pin
CPallini15-Mar-12 4:28
mveCPallini15-Mar-12 4:28 
GeneralReturn c_str() from function Pin
elelont215-Mar-12 3:44
elelont215-Mar-12 3:44 
GeneralRe: Return c_str() from function Pin
Erudite_Eric15-Mar-12 3:55
Erudite_Eric15-Mar-12 3:55 
GeneralRe: Return c_str() from function Pin
enhzflep15-Mar-12 3:59
enhzflep15-Mar-12 3:59 
GeneralRe: Return c_str() from function Pin
CPallini15-Mar-12 4:03
mveCPallini15-Mar-12 4:03 
GeneralRe: Return c_str() from function Pin
elelont215-Mar-12 4:38
elelont215-Mar-12 4:38 
GeneralRe: Return c_str() from function Pin
CPallini15-Mar-12 8:40
mveCPallini15-Mar-12 8:40 
GeneralRe: Return c_str() from function Pin
Erudite_Eric15-Mar-12 22:11
Erudite_Eric15-Mar-12 22:11 
GeneralRe: Return c_str() from function Pin
CPallini15-Mar-12 22:24
mveCPallini15-Mar-12 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.