Ik heb de volgende interface:
Als ik op deze manier Notify aanroep werkt het:
Als ik het op de volgende manier doe, krijg ik access violations
Kan iemand wat licht op de zaak schijnen voor mij?
code:
1
2
3
4
5
6
7
8
| IObserver = interface
procedure Notify;
end;
type
TFoo = class(TInterfacedObject, IObserver)
procedure Notify;
end; |
Als ik op deze manier Notify aanroep werkt het:
code:
1
2
| Foo := TFoo.Create; IObserver(Foo).Notify; |
Als ik het op de volgende manier doe, krijg ik access violations
code:
1
| IObserver(Pointer(Foo)).Notify; |
Kan iemand wat licht op de zaak schijnen voor mij?