Access violation at address 004B4940 in module 'ACU.EXE'. Read of address FFFFFFFF.
이런 에러가 나여..
클래스는
TCmmACC = class(TDataRec)
ACCCount : integer;
AutoID : integer;
ACCFlag : integer;
ReqID : string;
ErrCk : string;
ACCState : array of TDataRec;
CMDState : array of TDataRec;
public
constructor Create();
function TXCMD(): String;
procedure RXSts(buff : string);
procedure CardRead(CKAID : string; CKData : string);
Procedure ACCRequest(CKAID : string; CKData : string);
Procedure ACCHistory(CKAID : string; CKData : string);
end;
-------------------------------------------------------------------
constructor TCmmACC.Create();
var
i : integer;
begin
ACCFlag := 0; <---
AutoID := 0; <---
with dbModule.qryAcc do begin
close;
SQL.Clear;
SQL.ADD('select COUNT(*) from "Gigi.db"');
open;
end;
ACCCount := dbModule.qryAcc.Fields[0].AsInteger; <----
SetLength(CMDState,ACCCount);
SetLength(ACCState,ACCCount);
SetLength(ErrCK,ACCCount);
for i := 0 to ACCCount do begin
CMDState[i].CMD := 'R';
CMDState[i].AID := '0';
CMDSTate[i].CMDData := '';
ACCState[i].CMD := 'R';
ACCState[i].AID := '0';
ACCState[i].CMDData := '';
ErrCK[i] := '0';
end;
end;
<--- 이거 있는 부분에서 에러가 나여...
왜 이런 에러가 나는지.. ㅠ.ㅠ
도와주셔여..
> Access violation at address 004B4940 in module 'ACU.EXE'. Read of address FFFFFFFF.
>
> 이런 에러가 나여..
>
> 클래스는
>
> TCmmACC = class(TDataRec)
>
> ACCCount : integer;
> AutoID : integer;
> ACCFlag : integer;
> ReqID : string;
> ErrCk : string;
> ACCState : array of TDataRec;
> CMDState : array of TDataRec;
> public
> constructor Create();
> function TXCMD(): String;
> procedure RXSts(buff : string);
> procedure CardRead(CKAID : string; CKData : string);
> Procedure ACCRequest(CKAID : string; CKData : string);
> Procedure ACCHistory(CKAID : string; CKData : string);
> end;
>
> -------------------------------------------------------------------
>
>
>
> constructor TCmmACC.Create();
> var
> i : integer;
> begin
> ACCFlag := 0; <---
> AutoID := 0; <---
>
> with dbModule.qryAcc do begin
> close;
> SQL.Clear;
> SQL.ADD('select COUNT(*) from "Gigi.db"');
> open;
> end;
> ACCCount := dbModule.qryAcc.Fields[0].AsInteger; <----
>
> SetLength(CMDState,ACCCount);
> SetLength(ACCState,ACCCount);
> SetLength(ErrCK,ACCCount);
>
> for i := 0 to ACCCount do begin
> CMDState[i].CMD := 'R';
> CMDState[i].AID := '0';
> CMDSTate[i].CMDData := '';
> ACCState[i].CMD := 'R';
> ACCState[i].AID := '0';
> ACCState[i].CMDData := '';
> ErrCK[i] := '0';
> end;
>
>
> end;
>
>
>
> <--- 이거 있는 부분에서 에러가 나여...
>
> 왜 이런 에러가 나는지.. ㅠ.ㅠ
>
> 도와주셔여..
dbModule에 있는 component들이 생성되지 않은 것 같군요.
메인 폼이 Create될때 TCmmACC의 객체의 생성자를 호출하는 것 같은데
메인 폼이 Show될때 TCmmACC의 객체의 생성자를 호출하면 될 것 같은데요.