🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.migration
Article #234

Re: BCB5 to 2007

#234
From: Remy Lebeau (TeamB)
Date: Fri, 14 Mar 2008 20:12
42 lines
3085 bytes
"Marshall" <infsoft@centurytel.net> wrote in message 
news:47dad19c$1@newsgroups.borland.com...

> I keep getting the error during compile time of
>
> "[BCC32 Error] misc100.cpp(11): E2147 'TStringGrid' cannot start a 
> parameter declaration"

That error means that TStringGrid has not been defined yet.  You do not have 
Grids.hpp included in the code, or have not made a forward declaration for 
it, before trying to use it in the function declaration.

> #include <vcl.h>

Including vcl.h by itself is not enough to pull in everything the VCL has to 
offer.  Many times, you still need to include other header files as well. 
In this case, you are trying to use types that are defined in Forms.hpp and 
Grids.hpp.  TForm works fine because vcl0.h always includes Forms.hpp. 
However, if you look at what vcl0.h actually does, you will see that 
Grids.hpp is included only if INC_VCLEXT_HEADERS is defined. 
INC_VCLEXT_HEADERS is defined by vcl4.h.  When you include vcl.h in your 
code, the compiler automatically substitutes it with either vcl1.h, vcl2.h, 
vcl3.h, or vcl4.h, based on the project settings.  Each one of those header 
files defines a different set of options for vcl0.h to use.

So, what is likely happening is that your BCB 5 project is configured in 
such a way that the compiler decides to use vcl4.h, but your BCB 2007 
project is configured in such a way that a different VCL header file is used 
instead, and thus Grids.hpp is not being included automatically.

It is for reasons like this that you should never rely on the compiler's 
internal behavior to do things for you.  If you need to use TStringGrid, 
then you should explicitally include Grids.hpp in your own code.  If vcl.h 
includes Grids.hpp on its own, then your inclusion will simply be ignored. 
But in both cases, TStringGrid will be a known type for your code to use. 
This logic applies to every other data type you ever want to use in any 
project.  Don't make assumptions about what the compiler may or may not 
define automatically.


Gambit
Technical Details
Message-ID: <47dadc3e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <47dad19c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,d6bd45b17d20d4da
X-Google-Attributes: gid110f51,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.migration
References: <47dad19c$1@newsgroups.borland.com>
Subject: Re: BCB5 to 2007
Date: Fri, 14 Mar 2008 13:12:59 -0700
Lines: 44
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 207.178.157.90
Message-ID: <47dadc3e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1205525566 207.178.157.90 (14 Mar 2008 13:12:46 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 2920