C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[67263] TFileStream 파일 가져오기 질문좀요
축구 [] 1017 읽음    2012-05-21 16:11
st_Test stTest;

stTest.nTestSize = AData.Length;
stTest.DateTime = now;
stTest.strIP = strIP;
stTest.strPORT = strPORT;

TFileStream *pSendHeaderData = new TFileStream(Edit1->Text, fmOpenWrite|fmShareExclusive);

pSendHeaderData->Seek(0, SEEK_END);

pSendHeaderData->Write((void *)&stTest, sizeof(st_Test));
pSendHeaderData->Write(&AData[0], AData.Length);

delete pSendHeaderData;

파일에 저장하고요, 불러들이는게 어려운데요

TFileStream *pFileStream = new TFileStream(OpenDialog1->FileName, fmOpenRead);
st_Test *stTest = new st_Test();

pFileStream->Position = 0;

    while(pFileStream->Position < pFileStream->Size)
    {
        pFileStream->Read(stTest , sizeof(st_Test ));  //쓰레기값 들어감

        TBytes ReadBytes;
        ReadBytes.Length = stTest ->nFileTotalSize;
        pFileStream->Read((void *)ReadBytes[0], ReadBytes.Length);  //집어넣은 값말고, 쓰레기
                                                                                                                                                       값이 들어옴
        TDateTime now;
        now = stTest ->strDateTime;  //여기서 오류

        String strIP;
        String strPORT;
        strIP = stTest ->strIP;
        strPORT = stTest ->strPORT;

        PrintReceveList(now, strIP, strPORT, ReadBytes);   //출력함수
    }
    delete stTest ;
    delete pFileStream;

이렇게 했는데 저 위에 왜 쓰레기 값이 들어올까요???  도저히 모르겠어요

+ -

관련 글 리스트
67263 TFileStream 파일 가져오기 질문좀요 축구 1017 2012/05/21
67278     Re:TFileStream 파일 가져오기 질문좀요 송신영 1074 2012/05/22
67280         Re:Re:TFileStream 파일 가져오기 질문좀요 축구 1004 2012/05/22
67281             Re:Re:Re:TFileStream 파일 가져오기 질문좀요 송신영 1588 2012/05/22
67282                 Re:Re:Re:Re:TFileStream 파일 가져오기 질문좀요 축구 1198 2012/05/22
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.