Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

crash unless __fastcall

0 views
Skip to first unread message

Michael Beauregard

unread,
Mar 31, 1998, 3:00:00 AM3/31/98
to

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.
Everything compiles, but if I call some real C++ from Builder event handler
code, I find that the app will crash unless I pepper my C++ code with
__fastcall. In fact, it doesn't look like all functions need it, just some
here and there. Either way, do I need to add __fastcall to all of existing
classes (ugh!)?

Please let there be an easier way...

Michael.

Kent Reisdorph (TeamB)

unread,
Mar 31, 1998, 3:00:00 AM3/31/98
to

>>Either way, do I need to add __fastcall to all of existing
classes (ugh!)?

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

Michael Beauregard

unread,
Mar 31, 1998, 3:00:00 AM3/31/98
to

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.

Neil Booth

unread,
Mar 31, 1998, 3:00:00 AM3/31/98
to

"Michael Beauregard" <invalid@e-mail> burst forth:

>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.

Alan E (Borland)

unread,
Mar 31, 1998, 3:00:00 AM3/31/98
to

__fastcall is only needed for VCL objects, it specifies that a function
wants the parameters passed in the registers (as explained in the help).

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

0 new messages