Einzelnen Beitrag anzeigen

Chaosente

Registriert seit: 20. Aug 2006
80 Beiträge
 
#1

Fehler: AccessViolation, nur warum...

  Alt 1. Sep 2006, 17:04
Delphi-Quellcode:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, XpMan, StdCtrls, Menus, OleCtrls, SHDocVw_TLB, ComCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Memo1: TMemo;
    ComboBox1: TComboBox;
    Edit3: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    MainMenu1: TMainMenu;
    Main1: TMenuItem;
    Label5: TLabel;
    WebBrowser1: TWebBrowser;
    Button1: TButton;
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    ProgressBar1: TProgressBar;
    Label6: TLabel;
    Verlauf1: TMenuItem;
    Beenden1: TMenuItem;
    ffnen1: TMenuItem;
    Lschen1: TMenuItem;
    procedure Lschen1Click(Sender: TObject);
    procedure ffnen1Click(Sender: TObject);
    procedure Beenden1Click(Sender: TObject);
    procedure WebBrowser1ProgressChange(ASender: TObject; Progress,
      ProgressMax: Integer);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
pagecontrol1.ActivePage:=tabsheet2;
TOleControl(Webbrowser1).Visible := False;
form1.DoubleBuffered:=true;
Combobox1.Items.Add('mth.Main');
Combobox1.Items.Add('mth.Alternative');
Combobox1.Items.Add('mth.Club');
Combobox1.Items.Add('mth.Electro');
Combobox1.Items.Add('mth.Black');
Combobox1.Items.Add('mth.Break');
Combobox1.Items.Add('mth.House');
Combobox1.ItemIndex:=0;
Memo1.Text:='';
WebBrowser1.Navigate('http://www.shouted.fm/index.php');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.OleObject.document.forms.item(1).elements.item('name').value:=Edit1.Text;
WebBrowser1.OleObject.document.forms.item(1).elements.item('alter').value:=Edit3.Text;
WebBrowser1.OleObject.document.forms.item(1).elements.item('wohnort').value:=Edit2.Text;
WebBrowser1.OleObject.document.forms.item(1).elements.item('stream').selectedIndex:=ComboBox1.ItemIndex;
WebBrowser1.OleObject.document.forms.item(1).elements.item('nachricht').value:=memo1.Text;
WebBrowser1.OleObject.document.forms.item(1).submit;
end;

procedure TForm1.WebBrowser1ProgressChange(ASender: TObject; Progress,
  ProgressMax: Integer);
begin
if webbrowser1.ReadyState = 0 then begin
progressbar1.Position:=20;
end
else if webbrowser1.ReadyState = 1 then begin
progressbar1.Position:=35;
end
else if webbrowser1.ReadyState = 2 then begin
progressbar1.Position:=60;
end
else if webbrowser1.ReadyState = 3 then begin
progressbar1.Position:=100;
pagecontrol1.ActivePage:=tabsheet1;
end
end;

procedure TForm1.Beenden1Click(Sender: TObject);
begin
close;
end;

procedure TForm1.ffnen1Click(Sender: TObject);
begin
ShowMessage('Noch nicht implementiert');
end;

procedure TForm1.Lschen1Click(Sender: TObject);
begin
ShowMessage('Noch nicht implementiert');
end;

end.
Ich bekomme ne Fehlermeldung in der Steht was von EAccessviolation... keine ahnung was mir das sagen soll....
  Mit Zitat antworten Zitat