Board index » delphi » D5 bug : identifier names conflict in generated xx_TLB.pas

D5 bug : identifier names conflict in generated xx_TLB.pas

Hello,

I'm converting a D4 project using an ActiveX to D5. The problem I encounter
is that some of the interface methods of the ActiveX use an argument names
"result". With D4, it was automatically renamed to "result_", so that the
resulting TLB.pas compiled ok (apart from a small omission in the generated
implemenation of a method). D5 does not generate this renaming, so that I
get a bunch of compile error, and I'm forced to manually patch the generated
TLB.pas (the method declarations and the statements that use the "result"
argument).

Is there any workaround for this (for instance, is there some list of
identifier that will be automaticall renamed that could be updatable) ?

TIA a lot.

Regards
Eric

 

Re:D5 bug : identifier names conflict in generated xx_TLB.pas


Eric,

Take a look at tlibimp.sym in Delphi5\bin.  You can use this file to remap
names that the type library import wizard will generate.

Lance

Quote
Eric Pascual <eric_pasc...@csi.com> wrote in message

news:7up8nj$kdl1@forums.borland.com...
Quote
> Hello,

> I'm converting a D4 project using an ActiveX to D5. The problem I
encounter
> is that some of the interface methods of the ActiveX use an argument names
> "result". With D4, it was automatically renamed to "result_", so that the
> resulting TLB.pas compiled ok (apart from a small omission in the
generated
> implemenation of a method). D5 does not generate this renaming, so that I
> get a bunch of compile error, and I'm forced to manually patch the
generated
> TLB.pas (the method declarations and the statements that use the "result"
> argument).

> Is there any workaround for this (for instance, is there some list of
> identifier that will be automaticall renamed that could be updatable) ?

> TIA a lot.

> Regards
> Eric

Re:D5 bug : identifier names conflict in generated xx_TLB.pas


Thanks a lot Lance for your suggestion. I'll check this file.

Just a precision : where did you find the information about this file ? In
Delphi documentation or just by poking here and there ? I confess belonging
to this class of people that put documentation books on the shelf, and then
let them be covered by dust. Shame on me :-(

Thanks again for your reply and best regards
Eric

Lance C. Bullock <La...@dvdata.com> a crit dans le message :
7uq9fh$qj...@forums.borland.com...

Quote
> Eric,

> Take a look at tlibimp.sym in Delphi5\bin.  You can use this file to remap
> names that the type library import wizard will generate.

> Lance

Re:D5 bug : identifier names conflict in generated xx_TLB.pas


Hi Lance,

I've tried to modify tlibimp.sys as you suggested by adding a
"result=result_" entry, but the generated interface methods still contains
the unmodified "result" argument. Note that  the it is defined as an out
argument in the IDL.

I've tried to put the mapping setting in each section present in the file,
but without any success. I have even tried to add a section with the GUID of
the involved interface, but no way. BTW this would not have been very
practical, since the TLB contains a lot of interfaces, so that it would have
been a real pain to define a mapping section for each interface.

I've looked at D4 tlibimp.sym, and found that it contains a Result entry
(but in a very simplified version : no section, any no mapped form). And it
works.

Anyone has an idea ?

TIA and best regards
Eric

Lance C. Bullock <La...@dvdata.com> a crit dans le message :
7uq9fh$qj...@forums.borland.com...

Quote
> Eric,

> Take a look at tlibimp.sym in Delphi5\bin.  You can use this file to remap
> names that the type library import wizard will generate.

> Lance

Re:D5 bug : identifier names conflict in generated xx_TLB.pas


Ok, it does look like they broke it.  The type library importer calls into
the sym file at certain times to get the identifier remapping information.
It looks to me like they are no longer trying to resolve parameter names at
all (only members and types).  There are other problems (no methods when
importing ActiveX) as well so you're probably better off using tlibimp from
Delphi 4 for the time being.

Lance

Quote
Eric Pascual <eric_pasc...@csi.com> wrote in message

news:7v3o3n$g3c7@forums.borland.com...
Quote
> Hi Lance,

> I've tried to modify tlibimp.sys as you suggested by adding a
> "result=result_" entry, but the generated interface methods still contains
> the unmodified "result" argument. Note that  the it is defined as an out
> argument in the IDL.

> I've tried to put the mapping setting in each section present in the file,
> but without any success. I have even tried to add a section with the GUID
of
> the involved interface, but no way. BTW this would not have been very
> practical, since the TLB contains a lot of interfaces, so that it would
have
> been a real pain to define a mapping section for each interface.

> I've looked at D4 tlibimp.sym, and found that it contains a Result entry
> (but in a very simplified version : no section, any no mapped form). And
it
> works.

> Anyone has an idea ?

> TIA and best regards
> Eric

> Lance C. Bullock <La...@dvdata.com> a crit dans le message :
> 7uq9fh$qj...@forums.borland.com...
> > Eric,

> > Take a look at tlibimp.sym in Delphi5\bin.  You can use this file to
remap
> > names that the type library import wizard will generate.

> > Lance

Re:D5 bug : identifier names conflict in generated xx_TLB.pas


Lance,

I'm thinking about posting a bug report. Seems to be reproducible enough...

Regard
Eric

Lance C. Bullock <la...@dvdata.com> a crit dans le message :
7v9v7f$9a...@forums.borland.com...

Quote
> Ok, it does look like they broke it.  The type library importer calls into
> the sym file at certain times to get the identifier remapping information.
> It looks to me like they are no longer trying to resolve parameter names
at
> all (only members and types).  There are other problems (no methods when
> importing ActiveX) as well so you're probably better off using tlibimp
from
> Delphi 4 for the time being.

> Lance

Other Threads