On Mon, Sep 19, 2011 at 2:51 AM, Martin Schreiber <[email protected]> wrote:
> On Monday 19 September 2011 03.43:22 Marcos Douglas wrote:
>> Hi,
>>
>> Many files of MSE source has {$interfaces corba}.
>> I would know why this approach was chose
>
> MSEgui does not use refcounted interfaces. Refcounted interfaces can not be
> used in combination with TComponent in FPC because FPC sometimes creates
> intermediate variables and calls _Release() after the component has been
> destroyed. MSEgui has its own object lifetime control handling and does not
> depend on compiler interface refcounting because I normally need full control
> on the object destroy moment.
>
>> and how this works if compile
>> in Delphi 7.
>>
> In Delphi refcounted COM interfaces and dummy _AddRef() _Release() functions
> will be used. That works in most cases. IIRC there are possible crashes in
> Delphi too.

I saw this in mseglob.pas. I'm thinking do the same idea.

>> I'm writing a lib that has many interfaces... but I'm using IInterface
>> (i.e. IUnknow) and TInterfacedObject.
>>
> That should be OK but *never* call <theinterfaceobject>.Destroy() or Free() if
> you can't guarantee that there are no interface references left. On FPC there
> always can be references in intermediate variables you don't know of.

Yes, I had this problem...

>> The variables are interface type and I'm using ref-counted.
>> Using CORBA I think this is inverse: variable are classes and have not
>> ref-counted... so, I can only use variables that are classes not
>> interface type, right?
>>
> You can use CORBA interface variables additionally to the instance variable.

Here is my doubt: I can use variables additionally to the instance
variable -- that is one of advantages, the parameters of some methods
will be interfaces -- but I can not instantiate an interface variable,
because I can't release it. Is that right?

Resume:
1- In CORBA, I only can instantiate variables of concret class, but I
can use interfaces variables additionally to the instance variable, of
course;
2- In IUnknow, I only can instantiate variables of interfaces.

Can you confirm that?

Marcos Douglas
_______________________________________________
MSEide-MSEgui-talk mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mseide-msegui-talk

Reply via email to