Board index » cppbuilder » Wrong Overloaded method being called

Wrong Overloaded method being called

I have component written in Delphi and compiled to run in C++ Builder 5.
When I run the component from C++ Builder it calls the wrong overloaded
method, even though the parameters do not match.  Any Ideas?
 

Re:Wrong Overloaded method being called


Hi ,

we have been once faced with the same problem. In our case the compiler
built an
inconsistent vtable, because the Pascal compiler is case insensitive and
there was a
 Pascal method, which didn't exactly match the overridden method name. After
changing
the method name in the pas file and a complete rebuild (to be sure, delete
all *.obj) all
things work as expected.

Unfortunately there isn't any tests, if there exists such inconsistencies,
as far as I know.

Best regards
Michael

Quote
"Garfield" <hope...@palmsoft.com> wrote in message news:3c557913_2@dnews...
> I have component written in Delphi and compiled to run in C++ Builder 5.
> When I run the component from C++ Builder it calls the wrong overloaded
> method, even though the parameters do not match.  Any Ideas?

Re:Wrong Overloaded method being called


In our situation, the case of our method calls is consistent.

"Michael Baumgaertner" <michael_baumgaert...@removethis.agilent.com> wrote
in message news:3c5646bf_2@dnews...

Quote
> Hi ,

> we have been once faced with the same problem. In our case the compiler
> built an
> inconsistent vtable, because the Pascal compiler is case insensitive and
> there was a
>  Pascal method, which didn't exactly match the overridden method name.
After
> changing
> the method name in the pas file and a complete rebuild (to be sure, delete
> all *.obj) all
> things work as expected.

> Unfortunately there isn't any tests, if there exists such inconsistencies,
> as far as I know.

> Best regards
> Michael

> "Garfield" <hope...@palmsoft.com> wrote in message

news:3c557913_2@dnews...

- Show quoted text -

Quote
> > I have component written in Delphi and compiled to run in C++ Builder 5.
> > When I run the component from C++ Builder it calls the wrong overloaded
> > method, even though the parameters do not match.  Any Ideas?

Re:Wrong Overloaded method being called


Quote
> In our situation, the case of our method calls is consistent.

You have to check the Pascal sources!
The problem we once had was with the freely available XDOM library.
There was a component derived and the function 'Notification' was
overridden. But the name used in the library was 'notification'. While this
wasn't a problem for the pascal compiler it was for the C++ compiler,
because the generated *.hpp file also had now a 'notification' function
which was of course seen as different to 'Notification'.

This lead to an inconsistent vtable resulting in calls to the wrong
functions

Torsten

Other Threads