Autor Beitrag
CASS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 160

WIN XP
D7 Enterprise
BeitragVerfasst: Do 13.07.06 22:14 
Hallo Leute,

kann mir jemand sagen, warum folgender Code immer einen Error auslöst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.StartClick(Sender: TObject);
var
  ProgramStartTick: Cardinal;
begin
  ActiveCommandLine := 1;
  WriteCommandLine();
  ProgramStartTick := GetTickCount;
end;


Grüße Cass
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 13.07.06 23:42 
Moin!

Kommentier doch mal Zeilen aus, bis es läuft, dann weißt du wo die Fehlerstelle ist. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
CASS Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 160

WIN XP
D7 Enterprise
BeitragVerfasst: Fr 14.07.06 00:23 
Fehler tritt immer bei folgendem Teil auf:
ausblenden Delphi-Quelltext
1:
ProgramStartTick := GetTickCount;					
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 14.07.06 00:33 
Moin!

An der Zeile und der zugehörigen Deklaration kann man ja nun nicht wirklich viel falsch machen. :gruebel:

Wenn du die Zeile rausnimmst, läuft´s? Sehr merkwürdig... :nixweiss:

Hab ich auch keine weitere Idee zu. :(

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
CASS Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 160

WIN XP
D7 Enterprise
BeitragVerfasst: Fr 14.07.06 09:36 
Komischerweise kommt ja auch ein EConvertError ohne Fehlerbezeichnung:
Im Programm ist ein Error vom Typ EConvertError mit folgender Meldung aufgetreten ''.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 15.07.06 14:34 
Schalt mal die Optimierung ab. Eventuell bleibt er nicht an dr richtigen Zeile stehen.
CASS Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 160

WIN XP
D7 Enterprise
BeitragVerfasst: Di 18.07.06 12:40 
Hallo Luckie,

hab die Optimierung ausgeschaltet, Ergebnis bleibt leider das gleiche. Er bleibt immer in der Zeile mit GetTickCount hängen. Ich versteh ja sowieso nicht, warum da ein EConvert Error auftritt. Eigentlich muss er ja gar nichts Konvertieren. Ist ja beides Cardinal, oder?!?
crowley
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 406

Win XP, Win Vista, Mandriva, Ubuntu
Delphi 4-8, Delphi 2006, Delphi 2007
BeitragVerfasst: Di 18.07.06 12:45 
versuch es vielleicht mal anstelle des Cardinal mit DWord, ab und an verschluckt sich Delphi erfahrungsgemäß bei Cardinal vs. DWord

C.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 18.07.06 12:57 
Also ich kann mir beim besten Willen nicht vorstellen, dass diese Zeile eine EConvertError-Exception auslöst. Die OH schreibt zu dieser Exception:
Delphi OH hat folgendes geschrieben:
EConvertError is raised when

  • An application makes an unsuccessful attempt to convert an integer, float, date, or time to a string, or to convert a string to one of these other types.
  • An application passes an invalid argument to a formatting routine.
  • An application attempts to assign one type of component derived from TPersistent to another component derived from TPersistent when such an assignment is not possible. For example, EConvertError is raised by the attempted assignment of a TButton control to a TEdit control.

Keiner dieser Punkte trifft auf deine Code-Zeile zu. Ich würde die entsprechenden Code-Stellen mal im CPU-Fenster mit dem Debugger durchgehen. So lassen sich die fehlerhaften Stellen am besten herausfinden..

Gruß, Motzi

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Softchaos67
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 103

XP Prof
Delphi 7
BeitragVerfasst: Di 18.07.06 13:23 
Welcher Typ ist den deine lokale Variable?
Falls Integer dann musst du ein Cardianl nehmen, dann gehts...

Nachtrag:
pardon, ist ja schon ein Cardinal

_________________
cum grano salis
Softchaos67
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 103

XP Prof
Delphi 7
BeitragVerfasst: Di 18.07.06 13:37 
Was macht denn Writecommandline()?
Manchmal bleibt der Debugger auf dem falschen(nächsten) Eintrag hängen. Vieleicht wurde die Exception schon vorher ausgelöst?
Compiliere mal mit Debug-DCU's, vielleicht kommst du dann näher ran.

_________________
cum grano salis