Autor Beitrag
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 31.12.02 12:16 
Hi,

ich hänge hier an einer einfachen Sache fest :shock:

ausblenden Quelltext
1:
2:
3:
4:
procedure TLiefStamm.DBEdit14DblClick(Sender: TObject);
begin
  ShellExecute(0, 'open', 'http://'+LiefModul.LiefDS.FieldByName ('INTERNET'), nil, nil, SW_SHOW);
end;


Beim Doppelklicken auf ein DBeditfeld soll der Browser gestartet werden und zwar mit der Web-Seite, die in dem DBedit drinsteht. Der Browser startet auch (habe das mit einer statischen www-Adresse probiert), aber ich kriegs nicht gebacken, an den Feldinhalt dran zu kommen. Irgendwo steh ich aufm Schlauch. :shock:

Gruß
Hansa
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Di 31.12.02 13:41 
Hi Hansa,

probiere das doch mal bitte :

ausblenden Quelltext
1:
2:
3:
4:
procedure TLiefStamm.DBEdit14DblClick(Sender: TObject); 
begin 
  ShellExecute(0, 'open', 'http://'+DBEdit14.Text, nil, nil, SW_SHOW); 
end;
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 31.12.02 14:12 
Hi bis11,

ich suche nach allem möglichen, nur an das einfache Wort Text habe ich nicht gedacht. :oops: Dabei habe ich es schon öfter genau so gemacht.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TLiefStamm.DBEdit14DblClick(Sender: TObject);
VAR www : string;
begin
  www := 'http://' + DBedit14.Text;
  ShellExecute(0, 'open', www, nil, nil, SW_SHOW);
  Form2.Hide;
end;


Der will das www aber als PChar. Schreibe ich das statt string in die Deklaration. klappt das www := ... + ... nicht mehr. Tja PChar habe ich noch gar nicht gebraucht. :shock:

Gruß
Hansa
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Di 31.12.02 14:24 
Es gibt jetzt zwei Möglichkeiten, wie du es machen kannst.

1.Möglichkeit :
ausblenden Quelltext
1:
2:
3:
4:
procedure TLiefStamm.DBEdit14DblClick(Sender: TObject); 
begin 
  ShellExecute(0, 'open', 'http://'+PChar(DBEdit14.Text), nil, nil, SW_SHOW); 
end;


2. Möglichkeit :
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TLiefStamm.DBEdit14DblClick(Sender: TObject); 
VAR www : String; 
begin 
  www := 'http://' + DBedit14.Text; 
  ShellExecute(0, 'open', PChar(www), nil, nil, SW_SHOW); 
  Form2.Hide; 
end;
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 31.12.02 14:32 
Hi bis11,

Danke für die Hilfe. Ich war jetzt bei @www angelangt. Da hat er zwar compiliert, aber nichts mehr gemacht. :mrgreen: Jetzt klappt aber alles.

Gruß
Hansa
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 31.12.02 14:43 
Hi,

da ist aber noch eine Frage in diesem Zusammenhang : Ist das ganze überhaupt Browser-unabhängig ? Ich will keinen zwingen den IE zu benutzen, bei diesem funktioniert es aber jetzt zumindest.

Gruß
Hansa
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Di 31.12.02 14:45 
Bei dieser Art, sollte das Programm geöffnet werden, welches für Internet-Adressen konfiguriert ist. Also jeder x-beliebige Browser.
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 31.12.02 17:32 
Hi,

wenn dem so ist, ist es ja gut.

Guten Rutsch 8)
Hansa