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

델파이 Q&A
Delphi Programming Q&A
[12039] MDIChild에서 쓰레드를 사용할때 Access Violation 에러가 발생합니다. ㅠㅠ
-_-;;;;; [] 2208 읽음    2008-05-22 15:52
기존에 NormalForm에서 MainForm 하나에 쓰레드 유닛하나를 얹어서
각각 사용하던 프로그램들을 
하나로 합쳐서 MDIForm으로 만들려고 합니다.
그런데...각각 사용할땐 문제가 없던 프로그램과 쓰레드가
MDIForm아래 MDIChild로 폼 형식만 바뀌었을 뿐인데...
MDIChild의 Edit박스를 접근을 하지 못하는 AV 에러를 띄웁니다.

MDI에서 쓰레드를 사용할땐 먼가 다르게 해야하나요?
물론 VCL에 접근하는 부분은 Synchronize로 처리했습니다.

MDIChild 에는 Edit 박스 1개와 실행버튼이 있구요.
실행버튼을 클릭하면 Edit박스의 내용이 있는지 확인하고
있을경우 검색을 실행하는 구조입니다.
그런데..버튼을 클릭하면 쓰레드유닛에서 Edit박스에 접근을 못하는군요...ㅠㅠ
어떻게 하면 오류를 수정하는지 원인은 무엇인지 조언을 부탁
드립니다.

아래는 Thread 유닛입니다.

unit Unit17;

interface

uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Gauges, DB, DBTables, jpeg, Grids;
 
type
  TNoMarcIsbnThread = class(TThread)
  procedure NoMarcIsbnEx;
  private
    { Private declarations }
  protected
    procedure Execute; override;

  end;

implementation

Uses Unit16;    <=== MDIChild 폼

procedure TNoMarcIsbnThread.Execute;
var
gbn, starttime  : string;
mRow,i : integer;
begin
while not terminated do begin
try
try

     Synchronize(ViewEx);

except
   
end;

finally
     Terminate;
end;
end; {while end}
end;



///////////////////
procedure TNoMarcIsbnThread.ViewEx;
var
gbn, starttime  : string;
mRow,i, totCnt : integer;
begin
try          
     if trim(Form16.Edit1.Text)='' then begin    < ==여기서 Access violation 이 발생하고 멈춤니다.
   showmessage('검색어를 입력하시오.... ');
   Exit;
   end;

  finally
  end;
end;
///////////////////

end.

+ -

관련 글 리스트
12039 MDIChild에서 쓰레드를 사용할때 Access Violation 에러가 발생합니다. ㅠㅠ -_-;;;;; 2208 2008/05/22
12041     Re:MDIChild에서 쓰레드를 사용할때 Access Violation 에러가 발생합니다. ㅠㅠ 박지훈.임프 1976 2008/05/23
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.