Hi all,
I am implementing a plugin architecture and am having a little trouble with
interfaces.
A plugin can ask a Manager (for which it has a handle) for an interface to a
data object. The data object is a reference counted descendant of
TInterfacedObject and acts as a proxy for the real object (which is not
reference counted).
The proxy object is created in the application and passed to the plugin dll
as an Interface. As soon as the local variable holding the proxy (in the
dll) goes out of scope the proxy is freed (correctly). However, the second
time the plugin function is called the whole thing bombs (unless I step
through it!!). When it is called the second time, a brand new proxy object
is created refering to the requested data object (which may be the same or a
different object).
I seem to be corrupting memory somewhere along the line but am unsure of
where. If I try and step through the code then the error does not manifest
itself till later. My first instinct was that the proxy object is not being
released correctly but that seems to be working fine.
Is there a fundamental problem with passing interfaces to DLLs? The
reference counting seems to be working fine but I can't guarantee it because
behaviour is different if I'm stepping through the code.
Phil.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"