SRL Archive - Help and Support

Runtime Error In Form.


skilld u

2008-03-23 00:54:11

I was working on the form for my miner and I keep getting this error:

[Runtime Error] : Exception: Access violation at address 00000000. Read of address 00000000 in line 305 in script

program New;

var
frmDesign : TForm;
Label1 : TLabel;
Edit1 : TEdit;
Edit2 : TEdit;
Edit3 : TEdit;
CheckBox1 : TCheckBox;
Edit4 : TEdit;
Edit5 : TEdit;
Edit6 : TEdit;
CheckBox2 : TCheckBox;
Edit7 : TEdit;
Edit8 : TEdit;
Edit9 : TEdit;
CheckBox3 : TCheckBox;
Edit10 : TEdit;
Edit11 : TEdit;
Edit12 : TEdit;
CheckBox4 : TCheckBox;
Edit13 : TEdit;
Edit14 : TEdit;
Edit15 : TEdit;
Edit16 : TEdit;
Edit17 : TEdit;
Edit18 : TEdit;
CheckBox5 : TCheckBox;
CheckBox6 : TCheckBox;
Button1 : TButton;

procedure StartClick(sender: TObject);
begin
frmDesign.ModalResult:= mrOk;
FreeForm(frmDesign);
end;

procedure FormStuff;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 290;
frmDesign.Height := 378;
frmDesign.Caption := 'Player Setup';
frmDesign.Color := clHighlight;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 32;
Label1.Top := 16;
Label1.Width := 207;
Label1.Height := 24;
Label1.Alignment := taCenter;
Label1.Caption := 'Skilld EveryWhere Miner';
Label1.Font.Color := clBlack;
Label1.Font.Height := -21;
Label1.Font.Name := 'MS Sans Serif';
Label1.Font.Style := [];
Label1.ParentFont := False;
Label1.Layout := tlCenter;
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 16;
Edit1.Top := 56;
Edit1.Width := 73;
Edit1.Height := 21;
Edit1.TabOrder := 8;
Edit1.Text := 'Player 1';
Edit2 := TEdit.Create(frmDesign);
Edit2.Parent := frmDesign;
Edit2.Left := 16;
Edit2.Top := 88;
Edit2.Width := 73;
Edit2.Height := 21;
Edit2.TabOrder := 9;
Edit2.Text := 'Player 1 Pass';
Edit3 := TEdit.Create(frmDesign);
Edit3.Parent := frmDesign;
Edit3.Left := 16;
Edit3.Top := 120;
Edit3.Width := 73;
Edit3.Height := 21;
Edit3.TabOrder := 10;
Edit3.Text := 'Player 1 Nick';
CheckBox1 := TCheckBox.Create(frmDesign);
CheckBox1.Parent := frmDesign;
CheckBox1.Left := 16;
CheckBox1.Top := 152;
CheckBox1.Width := 73;
CheckBox1.Height := 17;
CheckBox1.AllowGrayed := True;
CheckBox1.Caption := 'Active?';
CheckBox1.Checked := True;
CheckBox1.Font.Color := clSilver;
CheckBox1.Font.Height := -11;
CheckBox1.Font.Name := 'MS Sans Serif';
CheckBox1.Font.Style := [];
CheckBox1.ParentFont := False;
CheckBox1.TabOrder := 11;
Edit4 := TEdit.Create(frmDesign);
Edit4.Parent := frmDesign;
Edit4.Left := 104;
Edit4.Top := 56;
Edit4.Width := 73;
Edit4.Height := 21;
Edit4.TabOrder := 12;
Edit4.Text := 'Player 2';
Edit5 := TEdit.Create(frmDesign);
Edit5.Parent := frmDesign;
Edit5.Left := 104;
Edit5.Top := 88;
Edit5.Width := 73;
Edit5.Height := 21;
Edit5.TabOrder := 13;
Edit5.Text := 'Player 2 Pass';
Edit6 := TEdit.Create(frmDesign);
Edit6.Parent := frmDesign;
Edit6.Left := 104;
Edit6.Top := 120;
Edit6.Width := 73;
Edit6.Height := 21;
Edit6.TabOrder := 14;
Edit6.Text := 'Player 2 Nick';
CheckBox2 := TCheckBox.Create(frmDesign);
CheckBox2.Parent := frmDesign;
CheckBox2.Left := 104;
CheckBox2.Top := 152;
CheckBox2.Width := 73;
CheckBox2.Height := 17;
CheckBox2.AllowGrayed := True;
CheckBox2.Caption := 'Active?';
CheckBox2.Checked := True;
CheckBox2.TabOrder := 15;
Edit7 := TEdit.Create(frmDesign);
Edit7.Parent := frmDesign;
Edit7.Left := 192;
Edit7.Top := 56;
Edit7.Width := 73;
Edit7.Height := 21;
Edit7.TabOrder := 16;
Edit7.Text := 'Player 3';
Edit8 := TEdit.Create(frmDesign);
Edit8.Parent := frmDesign;
Edit8.Left := 192;
Edit8.Top := 88;
Edit8.Width := 73;
Edit8.Height := 21;
Edit8.TabOrder := 17;
Edit8.Text := 'Player 3 Pass';
Edit9 := TEdit.Create(frmDesign);
Edit9.Parent := frmDesign;
Edit9.Left := 192;
Edit9.Top := 120;
Edit9.Width := 73;
Edit9.Height := 21;
Edit9.TabOrder := 18;
Edit9.Text := 'Player 3 Nick';
CheckBox3 := TCheckBox.Create(frmDesign);
CheckBox3.Parent := frmDesign;
CheckBox3.Left := 192;
CheckBox3.Top := 152;
CheckBox3.Width := 73;
CheckBox3.Height := 17;
CheckBox3.AllowGrayed := True;
CheckBox3.Caption := 'Active?';
CheckBox3.Checked := True;
CheckBox3.TabOrder := 19;
Edit10 := TEdit.Create(frmDesign);
Edit10.Parent := frmDesign;
Edit10.Left := 16;
Edit10.Top := 192;
Edit10.Width := 73;
Edit10.Height := 21;
Edit10.TabOrder := 20;
Edit10.Text := 'Player 4';
Edit11 := TEdit.Create(frmDesign);
Edit11.Parent := frmDesign;
Edit11.Left := 16;
Edit11.Top := 224;
Edit11.Width := 73;
Edit11.Height := 21;
Edit11.TabOrder := 21;
Edit11.Text := 'Player 4 Pass';
Edit12 := TEdit.Create(frmDesign);
Edit12.Parent := frmDesign;
Edit12.Left := 16;
Edit12.Top := 256;
Edit12.Width := 73;
Edit12.Height := 21;
Edit12.TabOrder := 22;
Edit12.Text := 'Player 4 Pass';
CheckBox4 := TCheckBox.Create(frmDesign);
CheckBox4.Parent := frmDesign;
CheckBox4.Left := 16;
CheckBox4.Top := 296;
CheckBox4.Width := 73;
CheckBox4.Height := 17;
CheckBox4.AllowGrayed := True;
CheckBox4.Caption := 'Active?';
CheckBox4.Checked := True;
CheckBox4.TabOrder := 23;
Edit13 := TEdit.Create(frmDesign);
Edit13.Parent := frmDesign;
Edit13.Left := 104;
Edit13.Top := 192;
Edit13.Width := 73;
Edit13.Height := 21;
Edit13.TabOrder := 24;
Edit13.Text := 'Player 5';
Edit14 := TEdit.Create(frmDesign);
Edit14.Parent := frmDesign;
Edit14.Left := 104;
Edit14.Top := 224;
Edit14.Width := 73;
Edit14.Height := 21;
Edit14.TabOrder := 25;
Edit14.Text := 'Player 5 Pass';
Edit15 := TEdit.Create(frmDesign);
Edit15.Parent := frmDesign;
Edit15.Left := 104;
Edit15.Top := 256;
Edit15.Width := 73;
Edit15.Height := 21;
Edit15.TabOrder := 26;
Edit15.Text := 'Player 5 Nick';
Edit16 := TEdit.Create(frmDesign);
Edit16.Parent := frmDesign;
Edit16.Left := 192;
Edit16.Top := 192;
Edit16.Width := 73;
Edit16.Height := 21;
Edit16.TabOrder := 27;
Edit16.Text := 'Player 6';
Edit17 := TEdit.Create(frmDesign);
Edit17.Parent := frmDesign;
Edit17.Left := 192;
Edit17.Top := 224;
Edit17.Width := 73;
Edit17.Height := 21;
Edit17.TabOrder := 28;
Edit17.Text := 'Player 6 Pass';
Edit18 := TEdit.Create(frmDesign);
Edit18.Parent := frmDesign;
Edit18.Left := 192;
Edit18.Top := 256;
Edit18.Width := 73;
Edit18.Height := 21;
Edit18.TabOrder := 29;
Edit18.Text := 'Player 6 Nick';
CheckBox5 := TCheckBox.Create(frmDesign);
CheckBox5.Parent := frmDesign;
CheckBox5.Left := 104;
CheckBox5.Top := 296;
CheckBox5.Width := 73;
CheckBox5.Height := 17;
CheckBox5.AllowGrayed := True;
CheckBox5.Caption := 'Active?';
CheckBox5.Checked := True;
CheckBox5.TabOrder := 30;
CheckBox6 := TCheckBox.Create(frmDesign);
CheckBox6.Parent := frmDesign;
CheckBox6.Left := 192;
CheckBox6.Top := 296;
CheckBox6.Width := 73;
CheckBox6.Height := 17;
CheckBox6.AllowGrayed := True;
CheckBox6.Caption := 'Active?';
CheckBox6.Checked := True;
CheckBox6.TabOrder := 31;
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 104;
Button1.Top := 320;
Button1.Width := 73;
Button1.Height := 17;
Button1.Caption := 'Go!';
Button1.TabOrder := 32;
Button1.OnClick := @StartClick;
end;

procedure ShowForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('FormStuff', v);
end;

procedure ShowformModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowformModal', v); //this line :[
end;

begin
ShowForm;
SafeShowModal;
end.

mixster

2008-03-23 07:21:35

Works for me - it looks like you've got a dodgy plugin though. I remember that when I was messing with plugins and forgot an stdcall;

almost

2008-03-25 00:03:05

It didn't work for me until i replaced
Button1.OnClick := @StartClick; with
Button1.ModalResult:= MrOk;
You don't need a new procedure for that.