|
확실하지는 안구요, Update 함수안에 Repaint()를 써 보시져...
민인학 님이 쓰신 글 :
: 안녕하세요..
: 제가 이번에 파일복사시에...
: progress bar를 보여줄려 하는데...
: 아래와 같이 짰습니다..
: 근데.. 이상하게도.. 파일은 복사하고 있는데...
: 프로그래스바가 움직이질 않네요...
: 제가 뭘 잘못했나요?
: 부탁드립니다.
:
:
: <<<<<<<<<<<<<<<<<<<<<< thread.cpp >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
:
: // 쓰레드 입니다.
:
: void __fastcall EdifFileProgressThread::Update()
: {
: IproveGenNetList->ProgressBar->Position = (TProgressRange)((total_read_size/total_file_size)*100);
: IproveGenNetList->ProgressBar->Update();
: }
:
: void __fastcall EdifFileProgressThread::Execute()
: {
: char ibuilder_dir[MAX_SIZE];
:
: // open한 ipf파일위치에 ibuilder 디렉토리가 있는 검사후 없으면 만듬
: sprintf( ibuilder_dir, "%sibuilder", ipfdir);
: if (!DirectoryExists(ibuilder_dir))
: ForceDirectories(ibuilder_dir);
:
: IproveGenNetList->ProgressBar->Position = 0;
:
: // edif 파일들의 총 싸이즈를 알아냄(bytes)
: vector<import_file_info>::iterator data;
: for( data = ImportFilesInfo.begin(); data != ImportFilesInfo.end(); data++ ) {
: int handle;
: handle = open(data->EdifFile, O_RDONLY);
: total_file_size = total_file_size + filelength(handle);
: }
:
: for( data = ImportFilesInfo.begin(); data != ImportFilesInfo.end(); data++ ) {
: char dest_file[MAX_SIZE];
: sprintf( dest_file, "%s\\%s", ibuilder_dir, ExtractFileName(data->EdifFile) );
:
: int in, out, bytes = 0;
: char block[1024];
:
: in = open(data->EdifFile, O_RDONLY);
: out = open(dest_file, O_WRONLY|O_CREAT,S_IREAD|S_IWRITE);
: while((bytes=read(in,block,sizeof(block)))>0) {
: char temp[MAX_SIZE];
: total_read_size+=bytes;
: write(out,block,bytes);
: Synchronize(Update);
: }
: }
: }
:
:
:
: <<<<<<<<<<<<<<<<<<<<<<<<<<<<< main.cpp >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
:
: // 여기서 쓰레드를 호출합니다.
: void __fastcall TIproveGenNetList::FileCopy(TObject *sender)
: {
: EdifCopyProgress = new EdifFileProgressThread(NULL);
: EdifCopyProgress->Priority = tpTimeCritical;
: EdifCopyProgress->Resume();
: }
:
:
|