AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TStrings AccessViolatino Error

Ein Thema von patrickhessman · begonnen am 5. Mai 2006 · letzter Beitrag vom 6. Mai 2006
Antwort Antwort
patrickhessman
(Gast)

n/a Beiträge
 
#1

TStrings AccessViolatino Error

  Alt 5. Mai 2006, 21:05
Hallo!

1. Ich habe ein ganz seltsames Problem.
Delphi-Quellcode:
var
  l: TStrings;
begin
  l := TStrings.Create;
    l.LoadFromFile(<irgendwas>);
  l.Free;
end;
beschert mir immer einen AV Error.
Wie kommt das? Hab schon ein wenig gestöbert
bin aber auf nichts sinnvolles gestoßen.

2. Geht warscheinlich total schnell :
Wie erstelle ich eine kopie der datei A
nach B?

Danke im Vorraus!

Patrick H.
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#2

Re: TStrings AccessViolatino Error

  Alt 5. Mai 2006, 21:08
TStrings ist eine abstrakte Klasse. Nimm eine TStringList.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
patrickhessman
(Gast)

n/a Beiträge
 
#3

Re: TStrings AccessViolatino Error

  Alt 5. Mai 2006, 21:12
Vielen Dank!
Super schnelle Antwort. Funktioniert!!!!! =)
Aber was war mein Fehler? Was ist eine Abstrakte Klasse?
Bzw. was is das Problem mit Abstrakten Klassen?
Ich lerne gern dazu =)
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#4

Re: TStrings AccessViolatino Error

  Alt 5. Mai 2006, 21:14
Delphi-Referenz durchsuchenabstract
Zitat:
An abstract method is a virtual or dynamic method that has no implementation in the class where it is declared. Its implementation is deferred to a descendant class. Abstract methods must be declared with the directive abstract after virtual or dynamic. For example,

procedure DoSomething; virtual; abstract;

You can call an abstract method only in a class or instance of a class in which the method has been overridden.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von Bernhard Geyer
Bernhard Geyer

Registriert seit: 13. Aug 2002
17.171 Beiträge
 
Delphi 10.4 Sydney
 
#5

Re: TStrings AccessViolatino Error

  Alt 5. Mai 2006, 21:36
Zitat von patrickhessman:
Was ist eine Abstrakte Klasse?
Abstrakte Klasse
Windows Vista - Eine neue Erfahrung in Fehlern.
  Mit Zitat antworten Zitat
nat

Registriert seit: 10. Nov 2005
216 Beiträge
 
RAD-Studio 2009 Pro
 
#6

Re: TStrings AccessViolatino Error

  Alt 5. Mai 2006, 22:15
mach
Delphi-Quellcode:
var
  lst: TStrings;
begin
  lst := TStringList.Create;
  try
    lst.LoadFromFile(filename);
  finally
    lst.free;
  end;
end;
zur 2. frage nimm entweder ne funktion
Zitat:
BOOL CopyFile(
LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
oder machs mit 2 filestreams (falls du dazwischen evtl. noch rumfummeln mußt)
Delphi-Quellcode:
  fsIn := TFileStream.Create(inputfile, fmOpenRead or fmShareDenyWrite);
  try
    fsOut := TFileStream.Create(outputfile, fmCreate or fmShareDenyWrite);
    try
      fsIn.Position := 0;
      fsOut.CopyFrom(fsIn, fsIn.Size)
    finally
      fsOut.free;
    end;
  finally
    fsIn.free;
  end;
statt copyfrom könntest du auch blockweise lesen/schreiben und so z.B.
n statusbalken noch anzeigen lassen.
  Mit Zitat antworten Zitat
patrickhessman
(Gast)

n/a Beiträge
 
#7

Re: TStrings AccessViolatino Error

  Alt 6. Mai 2006, 09:55
Ok dann is jetzt alles klar! danke!
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:16 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz