Einzelnen Beitrag anzeigen

Benutzerbild von xZise
xZise

Registriert seit: 3. Mär 2006
Ort: Waldbronn
4.303 Beiträge
 
Delphi 2009 Professional
 
#1

Es soll keine Version mit den Parametern geben

  Alt 24. Mai 2009, 17:28
Hallo ihr,

ich habe ein Problem mit folgendem einfachen Code:

Delphi-Quellcode:
unit UMessageBox;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TDialogTyp = (dtNormal, dtFrage, dtFehler, dtWarnung);

function LibMessageBox(const AOwner : TComponent; const ACaption, AText : string; AButtons : TMsgDlgButtons; ADialogTyp : TDialogTyp) : Integer; overload;
function LibMessageBox(const AOwner : TComponent; const ACaption, AText : string; AButtons : TMsgDlgButtons; ADialogTyp : TDialogTyp; OnHilfeClick : TNotifyEvent) : Integer; overload;

implementation

function LibMessageBox(const AOwner : TComponent; const ACaption, AText : string; AButtons : TMsgDlgButtons; ADialogTyp : TDialogTyp) : Integer; overload;
begin
  Result := LibMessageBox(AOwner, ACaption, AText, AButtons, ADialogTyp, nil);
end;

function LibMessageBox(const AOwner : TComponent; const ACaption, AText : string; AButtons : TMsgDlgButtons; ADialogTyp : TDialogTyp; OnHilfeClick : TNotifyEvent) : Integer; overload;
begin
  Result := mrYes; // nur Beispiel
end;

end.
An sich nichts besonderes. Außer dass er in der Zeile 20 rum meckert:
Zitat:
[DCC Fehler] UMessageBox.pas(20): E2250 Es gibt keine überladene Version von 'LibMessageBox', die man mit diesen Argumenten aufrufen kann
Nun warum ist dies so? Weil ich kann doch die OnClick Eigenschaft eines Buttons auch auf "nil" setzen.

MfG
xZise
Fabian
Eigentlich hat MS Windows ab Vista den Hang zur Selbstzerstörung abgewöhnt – mkinzler
  Mit Zitat antworten Zitat