PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Christian Weilguny on September 20, 2010, 08:28:08 AM

Title: PBRow and TLB_400
Post by: Christian Weilguny on September 20, 2010, 08:28:08 AM
Hi,

I have a curious behaviour in this two programs (PBRow and TLB_400).

Independently from the settings in the options-dialog of both apps I get always only methods generated and no propertys.
I'm using direct interface.

May be some other configurations forces this behaviour, but I don't now what this can be.

Modified:
In Addition to this is in both programs no keyword opt or optional present even if it is defined in the dll.

Christian
Title: Re: PBRow and TLB_400
Post by: José Roca on September 20, 2010, 11:49:34 AM
Quote
Independently from the settings in the options-dialog of both apps I get always only methods generated and no propertys.
I'm using direct interface.

If the interface inherits from IUnknown, low-level COM interfaces don't use properties, only methods.

Quote
In Addition to this is in both programs no keyword opt or optional present even if it is defined in the dll.

Currently, PB is unable to set this flag in the type libraries that it generates.
Title: Re: PBRow and TLB_400
Post by: Christian Weilguny on September 20, 2010, 08:30:03 PM
Hi Jose,
QuoteIf the interface inherits from IUnknown, low-level COM interfaces don't use properties, only methods.
What is a low-level COM interface?

And why is this so?

Christian
Title: Re: PBRow and TLB_400
Post by: José Roca on September 20, 2010, 08:46:15 PM
Quote
What is a low-level COM interface?

One that inherits directly from IUnknown.

Quote
And why is this so?

Because the return value is used to return an error code, not another kind of value.
Title: Re: PBRow and TLB_400
Post by: Christian Weilguny on September 20, 2010, 09:13:38 PM
But I've changed the methods to props in the ready .inc file and it works fine.
Have I to expect errors from this?

Christian
Title: Re: PBRow and TLB_400
Post by: José Roca on September 20, 2010, 09:27:43 PM
I can't know, since you don't provide any code.

If you want properties, then use INHERIT IDispatch instead of INHERIT IUnknown, if it is your own .DLL, that I don't know.
Title: Re: PBRow and TLB_400
Post by: Christian Weilguny on September 20, 2010, 09:34:51 PM
I thought, with inherit IDispatch the accessing from an external exe is more complicated.
If this is the sure way, I'll go it.

Christian
Title: Re: PBRow and TLB_400
Post by: José Roca on September 20, 2010, 09:56:02 PM
Low-level COM  interfaces use a different calling convention. If you trick it to use the syntax for properties, how are you going to return an error code when needed?

Well, at least now you know why the browsers will only use the METHOD keyword instead of the PROPERTY keyword: Because low-level interfaces only use methods.
Title: Re: PBRow and TLB_400
Post by: Christian Weilguny on September 20, 2010, 10:24:06 PM
Thanks, Jose

no day without learning a new thing  :P

Christian