I'm using Delphi XE7 , with Thread Class. When i debug it , no exceptions appears , but many user report me this Error :
Thread Error : Handle Not Valid (6) ----- {using W7-W8-W10}
DECLARATION
type
TR_AG = class(TThread)
private
{ Private declarations }
protected
{ Public declarations }
Procedure Execute; override;
procedure EnableMenu;
procedure DisableMenu;
procedure ForceReboot;
public
end;
type
TR_DL = class(TThread)
private
{ Private declarations }
protected
{ Public declarations }
Procedure Execute; override;
end;
type
TR_CY = class(TThread)
private
{ Private declarations }
protected
{ Public declarations }
Procedure Execute; override;
procedure UpdCap;
end;
type
TThreadNameInfo = record
FType: LongWord;
FName: PChar;
FThreadID: LongWord;
FFlags: LongWord;
end;
type
TR_AG = class(TThread)
EVENTS ON FORM SHOW
TrAggiornamenti := TR_AG.Create(True);
TrAggiornamenti.FreeOnTerminate := true;
TrAggiornamenti.Resume; //Master Thread
PROCEDURE TR_AG.Execute;
inherited;
Synchronize(DisableMenu);
if Flag=True then
begin
TrCiclo := TR_CY.Create(True);
TrCiclo.FreeOnTerminate := true;
TrCiclo.Resume;
TrAggiornamenti.Suspend;
end;
PROCEDURE TR_CY.Execute;
var
P: PChar;
StrTmp: string;
begin
inherited;
// MANY AND MANY CODE OVER HERE
TrAggiornamenti.Resume;
end;
I don't know what can cause this error , cuz i launch this program in 01/05/16 and the error don't appear since december/16 I tried many ErrorFix Guide, but none of them work for me, Please, could somebody help me?What could be wrong with my Code?
Your help is appreciated, have a nice day Developers!