Opening Units in C++ Builder 10 starts with .h - c++builder

About half a year ago our company switched from C++ Builder 5 to the C++ Builder 10 Seattle. If you opened a unit in C++ Builder 5 (via the shortcut CTRL + F12) it automatically opened the .cpp file.
Now if you open a unit with C++ Builder 10, it starts with the .h file and I have to switch manually to the .cpp file. This sounds like a minor inconvenience, but it's really annoying that I have to switch every time I open a unit.
Is there a setting that allows me to switch to the old behaviour?

Related

C++ Builder (XE7) compile without linking?

Is it possible - only compile/make source in C++ Builder (XE7) without the long delay of linking?
If yes, is there a shortcut key for it?
It would be very useful when I just want to check if my code compiles at a point, but don't want to execute it.
mauroaraujo is right - since BCB4 or thereabouts the Project menu has an item that is misleadingly labelled 'Build ' + current source file. This compiles the current .cpp file (compiler switch -c). The item description in the documentation is a bit misleading as well.
The standard keyboard shortcut is Alt+F9 - the same as it always has been ever since the times of Turbo C/C++ (with the possible exception of some early C++Builder incarnations). The shortcut might change or disappear when certain editor key mappings are selected, though.
There seems to be no direct equivalent to 'Syntax check' item that becomes available in the Project menu when the current source is a .pas file, but for most practical purposes it should be close enough.
What the IDE doesn't seem to have is a command for compiling all sources without linking (sort of like a 'syntax check all sources'). However, you may be able to build a custom target where the link phase is configured to do nothing.

Cannot link the icon resource

I try to add an icon in my Delphi 5 project and compile/link it, but get the following error:
"[Error] RLINK32: Out of memory!"
What is the problem?
The icon is at http://www.shuling.net/temp/Project2.zip
Your icons include large style 256px icons that were introduced in the Vista time frame. The Delphi 5 tooling is incapable of linking them. As I recall, the brcc32 from Delphi 5 cannot handle these icons because 256px icons are represented in a .ico file as having size 0. They are also stored with PNG compression to keep the size manageable. The brcc32 from Delphi 5 knows nothing of this and simply cannot handle it.
When I was linking such icons to my old Delphi 6 projects I used the Microsoft resource compiler, rc.exe to compile the resources. The Delphi linker from Delphi 6 was able to link the compiled .res files.
I'm not sure whether or not the Delphi 5 linker will be able to do even that. If not then you will need a post-build action to link the resource to the file. However, if I recall correctly, all I had to do was use rc.exe to compile the .rc file to .res, and then let Delphi link that.
So, in summary you need to:
Compile the .rc file with a modern resource compiler, for example rc.exe.
Link the resulting .res file in the usual way with $R if Delphi 5 can do so. If it cannot, use a separate post-build too to link the .res file.

Delphi XE3 File Not Found GIFImage.dcu

My first question here - this is new install of Delphi XE3. I thought animated GIF support was now built in to Delphi (since 2007?).
When I drop a TImage on my form, all is good until I populate the Picture field with an animated GIF file. As soon as I do that, the IDE adds the following to my uses clause
uses ... , Vcl.Imaging.GIFImg, GIFImage;
At that point, the IDE and compiler say it can't find GIFImage.dcu
[dcc32 Fatal Error] pco.pas(7): F1026 File not found: 'GIFImage.dcu'
I've searched my system and I don't find a GIFImage.dcu file anywhere. There are some TGIFImage files in some of the RAD Studio folders - like .bpl, .bpi, .dcp, .lib, and two .hpp files - one for both TGIFImage and GIFImage.
If I go do a download of the GIFImage stuff from Finn's site here http://www.tolderlund.eu/delphi/, and then put the GIFImage.pas file in my project, the situation resolves itself.
But according to this post How to use Animated Gif in a delphi form, GIFImage is now built in to Delphi, so I don't think I should have to do that ... So what am I missing here? TIA.
The name of the unit in XE3 is Vcl.Imaging.GIFImg. The TGIFImage class is defined in that unit.
There is no GIFImage unit in XE3. Simply remove all references to that unit.
I guess at some point the unit was renamed. Probably when it was taken on by Embarcadero and incorporated into Delphi.
If I go do a download of the GIFImage stuff from Finn's site here http://www.tolderlund.eu/delphi/, and then put the GIFImage.pas file in my project, the situation resolves itself.
Don't do this. Delete those files. If you go down that route you will have two versions of the same GIF code.

Has anyone successfully built libjpeg with recent versions of CodeGear/Embarcadero RAD Studio?

It apparently used to compile with Borland's C++ Builder, but that was a long time ago. Now I need to get it compiling with bcc32 for use in a bit of code that was /intended/ to be cross-compiler.
Anyone done it already and want to give me some pointers?
Simply modifying the makefile in makefile.bcc appears to be sufficient.
remove the os2/dos check (# Are we under DOS or OS/2?)
set the compiler name to bcc32 instead of bcc
At least the current version (9c) supports C++ Builder out of the box (tested with 10.1).
Navigate to the source directory
Copy jconfig.bcc under name jconfig.h
With C++ Builder 10.3 you need an additional step, because libraries compiled with bcc32 cannot be used with bcc32c projects: Edit makefile.b32 and change the compiler name to bcc32c.
Execute "C:\Program Files (x86)\Embarcadero\Studio\
18.0\bin\make" -f makefile.b32 (replace the path with path to C++ Builder install directory)
Files you need for your project:
libjpeg.lib
All header files

Is there a way to change the default EXE icon in Delphi

Embarcadero just released a whole bunch of neat looking icons that I'd like to use to make my Delphi 7 and 2009 apps look fancier. Is there a setting (or hack) in those IDEs that lets me change the default exe icon?
You could always use a resource editor to find the icon in the Delphi ide or bpl and change it to something else. That would be permanent for all new projects.
Apart from the fact that Andrey answered exactly what you asked I assume you want to add more icons to your executable than just the one you can set in the project option? This can be done by adding a *.rc file to the project. The following line should go into your project:
{$R 'Icons.res' 'Icons.rc'}
The rc file is a plain text file that Delphi compiles into a res. To the rc file add 1 icon per line like this:
XIcon01 ICON ".\Images\ico\ADDRESS2.ico"
XIcon02 ICON ".\Images\ico\ADDRESS3.ico"
XIcon03 ICON ".\Images\ico\ADDRESS4.ico"
The first part is the name of the icon. I chose names that come after Mainicon alphabetically with Mainicon being the icon that you define in the project options. I'm not sure (maybe somebody can confirm?) but I think that Delphi compiles the first icon as the application icon so I made sure my additional icons sort later.
In case you want to change the application's icon at runtime you can use the 2 Application.Icon.LoadFromResource routines.
Hope that helps

Resources