Click here to Skip to main content
15,921,382 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to clear the screen in DOS Pin
V.1-Aug-04 20:38
professionalV.1-Aug-04 20:38 
AnswerRe: How to clear the screen in DOS Pin
ThatsAlok1-Aug-04 22:21
ThatsAlok1-Aug-04 22:21 
AnswerRe: How to clear the screen in DOS Pin
avenger_sb252-Aug-04 0:02
avenger_sb252-Aug-04 0:02 
AnswerRe: How to clear the screen in DOS Pin
Archer2822-Aug-04 4:43
Archer2822-Aug-04 4:43 
GeneralMS-ACCESS......few problems!!! Pin
Anonymous1-Aug-04 20:29
Anonymous1-Aug-04 20:29 
GeneralRe: MS-ACCESS......few problems!!! Pin
Michael P Butler1-Aug-04 22:49
Michael P Butler1-Aug-04 22:49 
Generalproblem getting size of file Pin
Archer2821-Aug-04 20:12
Archer2821-Aug-04 20:12 
GeneralRe: problem getting size of file Pin
David Crow2-Aug-04 3:57
David Crow2-Aug-04 3:57 
»Archer282« wrote:
//doesnt seem to work

Which means what? Is an error produced? Does the compiler complain? Does GetFileSize() return the wrong size? Does Format() not format the number correctly? Is an assertion fired, or an exception thrown?

How about:

HANDLE hFile = ::CreateFile(m_FileToSplit, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
    DWORD dwFileSize = ::GetFileSize(hFile, NULL);
    if (dwFileSize != INVALID_FILE_SIZE)
    {
        CString m_FileSize;
 
        if (dwFileSize < 0x100000)
            m_FileSize.Format("%f KB", (dwFileSize / 1024.0));
        else if (dwFileSize < 0x40000000)
            m_FileSize.Format("%f MB", (dwFileSize / 1048576.0));
        else
            m_FileSize.Format("%f GB", (dwFileSize / 1073741824.0));
    }
    
    CloseHandle(hFile);
}



"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


Generalatof question Pin
User 5838521-Aug-04 20:09
User 5838521-Aug-04 20:09 
GeneralRe: atof question Pin
Archer2821-Aug-04 20:35
Archer2821-Aug-04 20:35 
GeneralRe: atof question Pin
Rick York1-Aug-04 21:06
mveRick York1-Aug-04 21:06 
GeneralRe: atof question Pin
User 5838522-Aug-04 1:05
User 5838522-Aug-04 1:05 
GeneralRe: atof question Pin
ssiegel2-Aug-04 17:52
ssiegel2-Aug-04 17:52 
GeneralClashes of numbers in Resource.h files Pin
PrashantJ1-Aug-04 19:51
PrashantJ1-Aug-04 19:51 
GeneralRe: Clashes of numbers in Resource.h files Pin
Jaime Stuardo2-Aug-04 4:46
Jaime Stuardo2-Aug-04 4:46 
GeneralRe: Clashes of numbers in Resource.h files Pin
PrashantJ2-Aug-04 18:31
PrashantJ2-Aug-04 18:31 
GeneralRe: Clashes of numbers in Resource.h files Pin
Jaime Stuardo3-Aug-04 1:27
Jaime Stuardo3-Aug-04 1:27 
GeneralHelp with Compiling Error Pin
arunforce1-Aug-04 18:43
arunforce1-Aug-04 18:43 
GeneralRe: Help with Compiling Error Pin
Michael Dunn1-Aug-04 19:23
sitebuilderMichael Dunn1-Aug-04 19:23 
GeneralSQL Commands Pin
Zero_One_ADO1-Aug-04 17:43
Zero_One_ADO1-Aug-04 17:43 
GeneralRe: SQL Commands Pin
Anonymous1-Aug-04 19:52
Anonymous1-Aug-04 19:52 
Generalfiles and folders Pin
Tyrus1821-Aug-04 17:02
Tyrus1821-Aug-04 17:02 
GeneralRe: files and folders Pin
Ravi Bhavnani1-Aug-04 17:37
professionalRavi Bhavnani1-Aug-04 17:37 
Generaloy ! Pin
bikram singh1-Aug-04 18:11
bikram singh1-Aug-04 18:11 
GeneralRe: oy ! Pin
Ravi Bhavnani2-Aug-04 2:26
professionalRavi Bhavnani2-Aug-04 2:26 

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.