Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi deklaration unterscheidet sich von vorheriger ?!?!? (https://www.delphipraxis.net/29498-deklaration-unterscheidet-sich-von-vorheriger.html)

sieppl 9. Sep 2004 21:29


deklaration unterscheidet sich von vorheriger ?!?!?
 
:wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall:
:wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall:
:wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall: :wall:
Delphi-Quellcode:
  TMyListView = class(TCustomListView)
  private
    FExtTypes: Boolean;
    FThumbnailThread: TThumbnailThread;
    FImageList: TImageList;
  protected
  public
    property ExtTypes: Boolean read FExtTypes write FExtTypes;
    property ImageList: TImageList read FImageList write FImageList;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure TreeUpdate(NewRoot: PItemIDList);
    procedure ChangeBitmap(Bitmap: TBitmap; Index, Width, Heigth: Integer);
später im implemtationsteil: (mit STRG + SHIFT + C vervollständigt)
Delphi-Quellcode:
procedure TMyListView.ChangeBitmap(Bitmap: TBitmap; Index, Width, Heigth: Integer);
var
  ImageIndex: Integer;
begin
  ImageIndex := FImageList.Add(Bitmap, nil);
  FListView.Items[Index].ImageIndex := ImageIndex;
  FListView.Items[Index].Caption := Format('%s (%dx%d)',
  [FListView.Items[Index].Caption, Width, Height]);
end;
Fehlermeldung:
Deklaration von ChangeBitmap unterscheidet sich von vorheriger Deklaration
WIE BITTE ?!?!

Meflin 9. Sep 2004 21:32

Re: deklaration unterscheidet sich von vorheriger ?!?!?
 
könnte es sein dass die verwendung von "index" zu problemen führt? (weils fett gedruckt wird und so reserviert zu sein scheint)

Lord Dave 9. Sep 2004 21:34

Re: deklaration unterscheidet sich von vorheriger ?!?!?
 
Lässt sich bei mir ohne Fehlermeldung compilieren.
(Nur die Signaturen kopiert)
Delphi-Quellcode:
unit Unit2;

interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCTRLs;

type
TMyListView = class(TCustomListView)
  private
    FExtTypes: Boolean;

    FImageList: TImageList;
  protected
  public
    property ExtTypes: Boolean read FExtTypes write FExtTypes;
    property ImageList: TImageList read FImageList write FImageList;

    procedure ChangeBitmap(Bitmap: TBitmap; Index, Width, Heigth: Integer);
   end;

implementation


procedure TMyListView.ChangeBitmap(Bitmap: TBitmap; Index, Width, Heigth: Integer);
var
  ImageIndex: Integer;
begin
  ImageIndex := FImageList.Add(Bitmap, nil);
end;
end.

sieppl 9. Sep 2004 22:07

Re: deklaration unterscheidet sich von vorheriger ?!?!?
 
Ich bekomme den Fehler sobald ich den Typen TBitmap in der Deklaration benutze, am Index liegt es nicht. Das ist doch zum Hühner rupfen.. :wall:

SirThornberry 9. Sep 2004 22:10

Re: deklaration unterscheidet sich von vorheriger ?!?!?
 
dann liegt es vermutlich an den Uses. Stelle sicher das die Unit "windows" die erste in den uses ist

sieppl 9. Sep 2004 22:14

Re: deklaration unterscheidet sich von vorheriger ?!?!?
 
Zitat:

Zitat von SirThornberry
dann liegt es vermutlich an den Uses. Stelle sicher das die Unit "windows" die erste in den uses ist

jep, habe ich aúch gerade bemerkt. Graphics in Implementations-Teil benutzt. so ein sch* !!
jetzt erstmal wieder beruhigen.. :angel:

SirThornberry 9. Sep 2004 22:16

Re: deklaration unterscheidet sich von vorheriger ?!?!?
 
*lol* dann isses ja klar da im implementationsteil die TBitmapdeclaration aus Graphics genommen wird und im Declarationsteil die aus der Windowsunit

sieppl 9. Sep 2004 22:31

Re: deklaration unterscheidet sich von vorheriger ?!?!?
 
ja genau, ich tue mir selber auch schon leid. keine wunder, sitze seit 9 uhr am rechner und code.. :nerd:


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:58 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