🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11947

Re: Finding the name of the Program Files directory

#11947
From: Alan Bellingham
Date: Thu, 08 Jan 2004 16:58
51 lines
2955 bytes
Fernando  <frr@easyjob.net> wrote:

>On Wed, 7 Jan 2004 10:54:08 -0800, "Remy Lebeau \(TeamB\)"
><gambit47.no.spam@no.spam.yahoo.com> wrote:
>
>>You should not include the Windows headers before the #pragma hdrstop
>>statement.  That prevents the project from being able to use the VCL's
>>default precompiled headers correctly (if you have PCH enabled, that is).
>>Include them after the statement instead:
>>
>>    #include <vcl.h>
>>    #pragma hdrstop
>>    #include <windows.h>
>>    #include <shlobj.h>
>
>I though I was suposed to put header files that don't change very often before
>the pagma. Is this incorrect?

Well, this is one place where I'll disagree with Gambit.

What _I_ do looks like this:

  #include "PrecompiledHeaders.h"
  #pragma hdrstop

and then I set the IDE compiler options to cache the pre-compiled
headers in the same directory as the object files. The first file takes
a little longer to compile, but with a few dozen files compiling at less
than a second apiece, it's probably works out quicker than just
precompiling vcl.h.

I tend to #include any standard headers used by any sources in the
project into that header file, so it currently includes 34 headers,
including one that's 7 MB in its own right. (But not vcl.h, since it's a
pure Windows project.)

Some figures:

  Contents commented out - 60 files in 120 seconds
  Contents left in       - 80 files in 55 seconds (inc precompilation) 

What you _don't_ want to do, though, is to have different file sets
before the #pragma hdrstop. That will produce slowdowns, as the system
realises that the last file set was inconsistent with what's wanted this
time.

Alan Bellingham
-- 
Team Mongolian Wok
<url:http://www.borland.com/newsgroups/> Borland newsgroup descriptions
<url:http://www.borland.com/newsgroups/netiquette.html>      netiquette
Technical Details
Message-ID: <n00rvvgsuj38h8er20d4ru9mgbmp92okii@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <8rtnvvs0ekdahr4ti11p9tbhpvvek5taju@4ax.com> <3ffc198e$1@newsgroups.borland.com> <o5bovvo2ruigqkkvpvh35h8p4g7479hm54@4ax.com> <3ffc546d$1@newsgroups.borland.com> <3tuqvv4mo9148sc5pvns4noijsuc9j6sbb@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,8234f234f0df84a1
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-08 09:10:59 PST
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Finding the name of the Program Files directory
Date: Thu, 08 Jan 2004 16:58:36 +0000
Reply-To: alanb@episys.com
Message-ID: <n00rvvgsuj38h8er20d4ru9mgbmp92okii@4ax.com>
References: <8rtnvvs0ekdahr4ti11p9tbhpvvek5taju@4ax.com> <3ffc198e$1@newsgroups.borland.com> <o5bovvo2ruigqkkvpvh35h8p4g7479hm54@4ax.com> <3ffc546d$1@newsgroups.borland.com> <3tuqvv4mo9148sc5pvns4noijsuc9j6sbb@4ax.com>
X-Newsreader: Forte Agent 1.92/32.572
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.130
X-Trace: newsgroups.borland.com 1073581115 193.129.251.130 (8 Jan 2004 08:58:35 -0700)
Lines: 51
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail