Please let there be an easier way...
Michael.
I never use __fastcall unless I have to (overloaded VCL methods and event
handlers).
--
Kent (TeamB and TurboPower Software)
-----------------------------------------------------
BCB Solutions Web Page - http://www.turbopower.com/bcb
Kent Reisdorph (TeamB) wrote in message <6fr3fv$4t...@forums.borland.com>...
So what is happening? I don't have __fastcall except in BCB code. Within
that handler, I call a member function of a C++ object (not VCL, not event
handler, just a plain C++ object member). If I use the C++ code as is, I
get a crash when that function is called. If I modify my old C++ code with
__fastcall I will execute that call properly and it will crash if that
function makes a call to a c++ member that is not using __fastcall
convention. I found that if I kept adding __fastcall all the way down the
call stack, it would not crash. I did this until I ran into:
TArrayAsVectorIterator<MyClass> iter(myArrayOfMyClasses);
I obviously can't screw with the classlib definitions - so that is when I
decided to ask this group. I didn't know if it was language, vcl or IDE
compiler settings - that is why I cross posted and for that, I appologize.
I know that __fastcall is just a different calling convention, but is seems
like the linker is doing something weird -- is there a setting for the
linker that may be relevant. I haven't found one, but I've only just begun.
I am having many more portability problems from 5.02 -> BCB than I was led
to believe. Does my C++ library get thrown out the door?
Frustrated.
>I am new to BCB and am using BCB 3.0 Pro. I have never seen __fastcall
>before this week and none of the documentation describes why I need it in
>there. I thought that I would just use it blindly and everything seems to
>work - except when I pulled in a couple classes of C++ that I want to use.
It shouldn't be necessary for your other code. If you're crashing,
it's because the routine is being compiled to a different convention
than you are calling it with.
Anwyay, there is an easier way, check out Project Options | Advanced
Compiler | Calling Convention | Register
Neil.
Please avoid crossposting in these newsgroups, please take a minute to
review the guidelines provided in the .announce newsgroup.
Thank you.
--
Alan Ellis | Borland On-Line