jslarochelle
Programmer
I'm a Java programmer trying to write a little application in DELPHI (version 4).
I have a form that implements an interface:
In the implementation I have:
Everything compiles until I try to pass MainForm (an instance of TMainForm) to a method of another object that expects a IUserInterface. The signature of the method is something like:
I'm doing this in TMainForm.otherMethod;
I always get an error message saying that there is no overloaded method that can be used with these arguments. I use MainForm an instance of TMainForm declared in the interface of the unit.
Anyone as any idea why I get that error ?
I have a form that implements an interface:
Code:
{ Here's the interface (simplified)}
IUserInterface = interface
procedure reportError (errorMessage: string);
end;
{ Here are the pertinent parts of the form definition}
TMainForm = class(TForm, IUserInterface)
{ Stuff generated by the form designer...}
public
procedure reportError (errMsg: string);
procedure otherMethod;
{etc...}
end;
In the implementation I have:
Code:
procedure TMainForm.reportError (errMsg: string);
begin {...}
Everything compiles until I try to pass MainForm (an instance of TMainForm) to a method of another object that expects a IUserInterface. The signature of the method is something like:
Code:
procedure doSomething (var userInterf: IUserInterface);
I'm doing this in TMainForm.otherMethod;
I always get an error message saying that there is no overloaded method that can be used with these arguments. I use MainForm an instance of TMainForm declared in the interface of the unit.
Anyone as any idea why I get that error ?