Вниз
Скачать: 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.027 c
8-1143357037
Sco
2006-03-26 11:10
2006.10.29
glScale и яркость объекта


2-1159633389
crasher
2006-09-30 20:23
2006.10.29
Системная оболочка


2-1160720820
kolj
2006-10-13 10:27
2006.10.29
Робота с MS Word


2-1160769352
Plm
2006-10-13 23:55
2006.10.29
Подключение к базе Microsoft Access


5-1141656562
Belorus
2006-03-06 17:49
2006.10.29
Raize Components v4




   Наверх