|
답변 감사합니다.
아래처럼 Bigin~ , End~ , CellNumber~ 를 바꿀려고 하는데 힘드네요.
TFileStream *FStream = new TFileStream(OpenDialog1->FileName, fmOpenRead);
한 다음에 Bigin 하고 data를 읽고 end 하면 되는건가요?
그럼 아래의 3개 함수를 수정하면 될거 같은데 Write를 Read로 바꾸는거는 맞는지요?
어떻게 읽어 와야 하는지 좀 도와 주십시요.
fmOpenRead Help를 찾아서 FileRead 예제로 해도 이상한 숫자가 들어오고 Error가 나네요.
void __fastcall XlsBeginStream_Read(TStream *XlsStream, const WORD BuildNumber)
{
CXlsBof[4] = BuildNumber;
XlsStream->ReadBuffer(CXlsBof, sizeof(CXlsBof));
}
void __fastcall XlsEndStream_Read(TStream *XlsStream)
{
XlsStream->ReadBuffer(CXlsEof, sizeof(CXlsEof));
}
void __fastcall XlsReadCellNumber(TStream *XlsStream, const WORD ACol,
const WORD ARow, const double AValue)
{
?
CXlsNumber[2] = ARow;
CXlsNumber[3] = ACol;
XlsStream->ReadBuffer(CXlsNumber, sizeof(CXlsNumber));
XlsStream->ReadBuffer(&AValue, 8);
}
장성호 님이 쓰신 글 :
: [TFileStream 을 쓸때 ]
:
: 파일이 새로만들때는 아래와 같이 하지만
: TFileStream *FStream = new TFileStream("c:\\e.xls", fmCreate);
:
: 이미 있는 파일을 읽어오거나 수정할때는 mOpenRead 나 fmOpenReadWrite 를 쓰셔야 합니다.
: TFileStream *FStream = new TFileStream("c:\\e.xls", fmOpenRead);
:
: * 모드 (F1 하세요)
: fmCreate Create a file with the given name. If a file with the given name exists, open the file in write mode.
: fmOpenRead Open the file for reading only.
: fmOpenWrite Open the file for writing only. Writing to the file completely replaces the current contents.
: fmOpenReadWrite Open the file to modify the current contents rather than replace them.
:
: 먼저 저장할때 는?
:
: 1. BOF 저장 - 12 Byte
: 2. RK , Number , Label 를 반복해서 저장 - Cell Header(10~12 Byte ) + Data(4 Byte 또는 8Byte , 기타 )
: 3. EOF 저장 - 4 BYTE
: 위와같은 순서가 되잖아요
:
:
: Cell Header는
:
: CXlsNumber와 CXlsRk 는 10Byte이구
: CXlsLabel 은 12 Byte여서 그렇게 표현한것입다.
:
: ...
:
: 그럼..
|