Вниз
Скачать: CL | DM;

Интерфейсы и reinroduce   Найти похожие ветки 

← →
mfender ©   (2006-10-10 15:42) [0]

Есть два класса:

 
 TmfXMLLogMemo = class(TCustomMemo, ImfXMLLogMemo)
 public
   procedure Log(Data: string); virtual;
 end;

 TmfXMLExtLog = class(TmfXMLLogMemo, ImfXMLExtLog)
 public
   procedure Log(Data: string; RecType: string); reintroduce;
 end;


И их интерфейсы:


 ImfXMLLogMemo = interface(IInterface)
 ["{985E3293-E06B-41EA-B28D-091FEA31804F}"]
   procedure Log(Data: string);
 end;

 ImfXMLExtLog = interface(ImfXMLLogMemo)
 ["{07656F85-3E51-48E6-A4E8-6B5F0238B047}"]
   procedure Log(Data: string; RecType: string);
 end;


Как сделать так, чтобы компилятор не ругался "Declaration of "Log" differs from declaration in interface "ImfXMLExtLog""? Объявить метод в интерфейсе (reintroduce) так же как в реализации пытался. В ответ получил "Unknown dirrective "reintroduce""... Что я опять не правильно делаю?


← →
mfender ©   (2006-10-10 16:04) [1]

Ларчик просто открывался:


TmfXMLExtLog = class(TmfXMLLogMemo, ImfXMLExtLog)
public
  procedure Log(Data: string; RecType: string); overload;
end;


← →
guav ©   (2006-10-10 16:05) [2]

  TmfXMLExtLog = class(TmfXMLLogMemo, ImfXMLExtLog)
  public
    procedure ImfXMLExtLog.Log = ExtLog;
    procedure ExtLog(Data: string; RecType: string);
  end;


← →
mfender ©   (2006-10-10 16:18) [3]


> guav ©   (10.10.06 16:05) [2]

Классно! Спасибо! Даже не знал, что такое чудо можно в Delphi провернуть.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.028 c
3-1157372083
Dok
2006-09-04 16:14
2006.10.29
ADO+D6+unicode


9-1137854342
Yanis
2006-01-21 17:39
2006.10.29
Разбираю пример...


2-1160404831
Footballer
2006-10-09 18:40
2006.10.29
TCDBurnerLibrary


15-1160368764
nali
2006-10-09 08:39
2006.10.29
Не работает Delphi6


6-1149006478
Tananda
2006-05-30 20:27
2006.10.29
TNMUDP




   Наверх