Autor Beitrag
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Di 21.09.04 16:47 
folgender code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.loadClick(Sender: TObject);
var
a,b:integer;
loadfile:textfile;
string1:string;
begin
if opendialog1.Execute then
begin
 assignfile(loadfile,opendialog1.FileName);
 reset(loadfile);
 a:=1;
 while eof(loadfile)=false do
 begin
  readln(loadfile,string1);
//gekürz, da Programm für wettbewerb, ist auch unwichtig;
 closefile(loadfile);
end;
edit1.Text:=inttostr(a-1);
format1;
end;

erzeug in der Zeile 7 mit D8 compiliert die FehlerMeldung:

Ungültiges Thread-Modell(STAThreadAttribute erforderlich)

mit D6 compiliert gibt es keinerlei Probleme.


Moderiert von user profile iconChristian S.: Topic aus Off Topic verschoben am Di 21.09.2004 um 16:51
Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: Di 21.09.04 18:55 
D8 ist was ganz andres als die Delphi-Versionen davor! VCL-Code kannst du zwar eingeschränkt über VCL.NET weiter verwenden, aber spätestens bei den Textfiles wäre es so oder so gescheitert.

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Do 23.09.04 02:04 
Öffne mal die Projektdate (.dpr) und füge [STAThread] vor dem begin ein.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
uses
  ...;

[STAThread]
begin
  ...
end.

_________________
Ist Zeit wirklich Geld?