was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

35 Visitors Online


 
...verhindern, dass es unter XP eine Zugriffsverletzung mit TListView gibt?
Autor: Thomas Stutz
[ Tip ausdrucken ]  

Tip Bewertung (5):  
     


{
  The TListView with a vsReport style causes an access violation
  when you run your project with a XP manifest resource.

  The VCL wrapper has a bug and you must patch sources.
  Just copy the comctrls.pas unit in the folder with your own
  project and modify the UpdateColumn method.
  After compiling the project, a comctrls.dcu is created
  and you can replace the original comctrls.dcu with the
  patched one.

}

{
  Wenn ein XP Manifest als Ressource in eine Exe-Datei eingebunden
  wird, um einer Applikation das neue XP-Design zu verleihen,
  gibt es bei der TListView mit Style vsReport eine Zugriffsverletzung
  und die Anwenung lässt sich nicht starten.

  Das ist ein VCL Bug und kann behebt werden, indem
  comctrls.pas modifiziert wird.
  Kopiere die comctrls.pas in dein Projekte-Verzeichnis und
  ändere die UpdateColumn Methode wie folgt.
  Nach dem Kompilieren wird eine Comctrls.dcu Datei erstellt.
  Die original Comctrls.dcu kann nun durch die modifizierte ersetzt werden.
}


// ComCtrls.pas:

procedure TCustomListView.UpdateColumn(AnIndex: Integer);
{...}
with Column, Columns.Items[AnIndex] do
begin
  
{ PATCH start:}
  // mask := LVCF_TEXT or LVCF_FMT or LVCF_IMAGE;
  
mask := LVCF_TEXT or LVCF_FMT;
  if FImageIndex >= 0 then
    
mask := mask or LVCF_IMAGE;
  { PATCH :end }
  {...}
end;

 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners