Board index » delphi » Interfce variables get automatically nil'ed ?

Interfce variables get automatically nil'ed ?

Hi !

I have created a few classes in two groups, using interfaces to
reference each others. Example:

in interface unit:

IMyClass = interface
  procedure Dosomething;
end;

in unit A:

TClass1 = class
  FObject: IMyclass;
  FString: string;
  constructor create(Ref: IMyClass);
end;

constructor TClass1.Create(Ref: IMyClass);
begin
  FObject:=Ref;
end;

In unit B:

TClass2 = class(TObject, IMyClass)
  FString: string;
  function QueryInterface(const IID: TGUID; out Obj): hresult;
  function _addref: integer;
  function _release: integer;
  procedure DoSomething;
end;

-------

Now, in app I do:

--
Bjoerge Saether
Consultant / Developer
Asker, Norway
bsaether.removet...@online.no (remove the obvious)

 

Re:Interfce variables get automatically nil'ed ?


Ooops ! Sorry, I wasn't finished....should not have been sent

--
Bjoerge Saether
Consultant / Developer
Asker, Norway
bsaether.removet...@online.no (remove the obvious)

Bj?rge S?ther skrev i meldingen ...

Quote
>Hi !

>I have created a few classes in two groups, using interfaces to
>reference each others. Example:

Other Threads