poniedziałek, 21 sierpnia 2017

File explorer C++ Builder



private: // User declarations
int size_Buf;
wchar_t *Buf;
int Bytes;
TFileStream *file;
wchar_t *Text;
wchar_t *temp_Buf;



void __fastcall TForm1::FormCreate(TObject *Sender)
{
 Edit1->Text="1000";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FileListBox1Click(TObject *Sender)
{
 size_Buf=Edit1->GetTextLen();
 Buf=new wchar_t[++size_Buf];
 Edit1->GetTextBuf(Buf,size_Buf);
 Bytes=_wtoi(Buf);
 file=new TFileStream(FileListBox1->FileName,fmOpenRead);
 temp_Buf=new wchar_t[Bytes];
 file->Read(temp_Buf,Bytes);
 Memo1->SetTextBuf(temp_Buf);
 file->Free();
 delete Buf;
 delete temp_Buf;
}

Brak komentarzy:

Prześlij komentarz