Subj : Re: Pascal vs C++ (LONG!!)
To   : Simon Woodland
From : Scott Adams
Date : Tue Oct 22 2002 12:45 am

-=> Quoting Simon Woodland to Scott Adams <=-


SW>> There is hack on the internet that will let you turn Borland C++
SW>> into
SW>> a Delphi complier.

SA>         Not heard of that hack..hmmm

SW> As taken from the PCPlus Issue 184 page 277/8

SW> Delphi components with C++ Builder

       Actually it makes sense now that i'm not tired :)
       I forgot about the visual studio type setup and
       such so figured why not :)


SW> This month Dave Jewell delves into the wealth of Delphi components
SW> that are available for use within C++ Builder As promised last time,
SW> this month's C++Workshop takes a somewhat different format to usual.
SW> Rather than walking you through the development of a specific project,
SW> we're going to provide some pointers to the best Delphi components
SW> that are available for use with c++ Builder. If you're wondering why
SW> we're mentioning Delphi in C++ Workshop, you're probably not aware of
SW> the intimate relationship  between these two development systems. Read
SW> on, and all will be revealed...
SW> As you're probably aware, Delphi and C++ Builder have a great deal in
SW> common; they are both Borland RAD development tools, and they both use
SW> the same VCL application framework. However, the relationship is a lot
SW> tighter  than that. Delphi is based around the Pascal programming
SW> language and uses a lightning-fast compiler. Delphi appeared before C++
SW> Builder and almost the entire Delphi development is itself written
SW> using Delphi. The only significant exceptions to this are the Pascal
SW> compiler (written in plain vanilla C), the debugger and the guts of the
SW> text editor - everything else is Delphi.

SW> When Borland came to create C++ Builder, it just didn't make sense to
SW> go to the huge effort of rewriting everything in C++. Instead, Borland
SW> simply modified the IDE where appropriate, connected it up to a C++
SW> compiler and - hey presto - C++ Builder was born. OK, we're over-
SW> simplifying this somewhat, but hopefully you get the message: every
SW> time you fire up C++ Builder, you're actually running a Delphi
SW> application. When C++ Builder was first released, Borland was rather
SW> coy about this aspect of the product. Perhaps it figured that C++
SW> programmers wouldn't like to know that it was using a development tool
SW> written in Pascal.
SW> The truth is, no matter how ardent a C++ developer you are, the Pascal
SW> under-the-hood nature of C++ Builder is great news. Why? Because it
SW> means that C++ Builder is fully compatible with the huge number of
SW> Delphi components that are available. We'll be looking at some of the
SW> better ones in the remainder of this months C++ Workshop.

SW> Incorporating Pascal code into a C++ project

SW> Although we have focused on adding Delphi-authored components to a C++
SW> Builder project, there's nothing to stop you from incorporating any
SW> Pascal code into your C++ code
SW> To do this, simply click the Add File Project option on the IDE
SW> toolbar and select the .PAS file that you wish to incorporate into your
SW> project.
SW> This works because C++ Builder incorporates not only a full C++
SW> compiler, but also a full Pascal compiler too - the same one used in
SW> Delphi. If you go to the Project Options dialog and select the Compiler
SW> tab, you'll be able to see a set of compiler options that are used to
SW> control the operation of the built-in Pascal compiler. The fact that
SW> C++ Builder includes a Pascal compiler makes it very easy to include
SW> Pascal code in your project, and to transparently create Pascal classes
SW> and invoke Pascal methods directory from a C++ program.
SW> As we've already pointed out, this happens all the time because all
SW> the out-of-the-box components on the C++ Builder component palette are
SW> Delphi- authored controls. Sadly this only works  one way; whereas C++
SW> has a built-in Pascal compiler, there isn't a C++ compiler built into
SW> the Delphi system. Oh well... we can't have everything.







SW> Regards,
SW> Simon Woodland

SW> -!- APoint 1.25
SW>  ! Origin: Simon's Little Corner of the world (2:250/501.5)



... You should be intelligent enough to let others tell you what to do.
--- Fringe BBS
* Origin: EWOG II - The Fringe - 904-733-1721 (1:112/91)