Delphi XE3 File Not Found GIFImage.dcu - delphi

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.

Related

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.

xercesxmldom file not found in Delphi XE4

I am migrating my Delphi 7 code to Delphi XE4.
In one of the files in Delphi 7, I found xercesxmldom in the uses. I found that its dcu is placed in C:\Program Files\Borland\Delphi7\Lib.
When I tried to compile this file in Delphi XE4 environment, I got error xercesxmldom.dcu not found. I searched my entire C drive but it was not there anywhere.
I thought it is deprecated now. So I commented it out as it was nowhere used in the file and project compiled successfully.
Now when I try to open dfm file by double clicking on it, I get error No matching Dom Vendor: "XercesXML".
When pressed OK, dfm opens fine. I don't know why am I getting this error message?
The error you are seeing is because, although you have stopped referring to the xercesxmldom unit, your code still sets the DOM vendor to XercesXML. You'll need to choose a different DOM vendor. You need to locate everywhere in your program where you assign to the DOMVendor property and modify it accordingly.

OpenCV 2.3 in Embarcadero C++ Builder

When compiling a OpenCV 2.3 project in Builder I get multiple errors starting with "_fm_atan2l is not a member of 'std'" and continuing with other math related errors in that form. I also get "Multiple declaration of '_Ctraits::_Isnan(double)' and other similar errors. This happens after I simply include the OpenCV header files and thus seems unrelated to anything I have done in the application itself.
The only file I have included so far is "cv.h" in OpenCV's include directory. Am I doing it wrong already or is there maybe something else I have to set up first?
You can download simple project combining 2.3.2 and c++ builder xe2 from my site:
http://www.compvision.ru/forum/index.php?showtopic=763
There are fixed headers for builder, and lib converter in archive.
There are also .lib files in archive, but it'll be better if you make them by yourself from original .lib files contained in your opencv distribution using LibConverter.exe utility.
And there is some strange thing: some dll files need to be renamed to something like .dl or .d. Compiled program will prompt you about it.
you can correct OCV atan2 issue with bcc32, including fastmath in std namespace (for more info see: https://forums.embarcadero.com/message.jspa?messageID=363384 [^]).... but more other issues are there after ...
Until now I'm unable to build OCV 2.3.1 with CBuilder XE2 :(

Best way to make a component icon in Delphi XE using only the built in tools

In Delphi 7, an image editor program is included, which can read and write .dcr files, which are merely binary resource files (.res files) with a different extension, which by convention indicates that the .dcr file contains a compiled resource with named bitmap resources that have names corresponding to your component names (a bitmap resource named TMYCOMPONENT for a component named TMyComponent). These bitmaps are where the "icons" used to put an icon on the delphi component palette, and on your form or data-module when you drop a non-visual component on it, come from.
Fast forward 10 years to Delphi XE, and I am trying to make component icons using a bitmap file, and an RC file, and have that build to a .DCR file, as part of the Delphi IDE.
It should be simply a matter of adding an .Rc file and a declaration like this in the .dpk (package source) file, like this:
{$R mypackageicons.rc mypackageicons.dcr}
A sample .rc file containing a component icon:
// COMPONENT ICON RESOURCES
TMYCOMPONENT BMP "TMYCOMPONENT.BMP"
However I can not get this to work. It seems that you get some bizarre RLINK32 errors, and IDE crashes in borlandmm.dll, when I try it:
[DCC Error] E2161 Error: RLINK32: Unsupported 16bit resource in file "C:\temp\compicon\COMPONENTICONS.rc"
[DCC Fatal Error] F2084 Internal Error: AV21515155-W06000D07-1
The bitmap file in question is a simple 256 color bmp file size 24x24 pixels, and I have also tried 16 color bitmaps, with no luck. It seems to me that the ImageEdit program is the only way that I know of that I can use to create Delphi component icons.
What am I missing out on?
Update: The external tools are a nice solution for people who don't have access to the Delphi 7 image editor, and may in fact be superior, but I would prefer to do this using only what ships with Delphi, because it seems that it should be possible using just one {$R} declaration, a text file, and a bmp file made with paintbrush. Surely they didn't omit to make a way to make component icons, with this great big 1.5 gigabyte developer tool! .. update2: And there is a way; Rudy V. found it.
I have used and had great success with:
Colin Wilson's XN Resource Editor
Anders Melander's Resource Editor
Update
I just tried the following, in XE, and was successful.
I created a new component, TNewAnimate, in NewAnimates.pas.
I added TNewAnimate.pas to dclusr.dpk.
I added a bitmap (called TMRUComboBox.bmp, I just had that around anyway) using the Project → Resources and Images... dialog to the .dpk and gave it the name TNEWANIMATE.
I re-installed dclusr.dpk.
The source file for dclusr.pdk got a new entry {$R *.dres} (note the extension). I could see the TNewAnimate in the Samples palette with the glyph in TMRUComboBox.bmp.
I located dclusr.dres in the same directory as dclusr.dpk (which is normally under C:\Program Files, but not in my setup). I tried to open it with XN Resource Editor, but that refused to open it with a cryptic error message. It is not a normal .res file, it seems.
Try Resource Editor. A nice replacement for old Image Editor.
First add 'mypackageicons.rc' file to the project, this produces 'mypackageicons.res' at compile time (see related SO answer to the question "Including resource file in a project by .RC file rather than .RES file").
Also include {$R mypackageicons.res mypackageicons.dcr} to the component unit (or to the .dpk). This does not produce a '.dcr file', but sets the icon for the component.
Note that my test with a 'BMP' resource failed. I used 'BITMAP' as resource type.
I have investigated the previous responses using Delphi XE5 upd2. Not much success. So I tried to build a new solution and found one derived from previous answers.
In short:
1. Create your bitmap using Windows Paint program.
2. Create a resource script file with the bitmap.
3. Compile the script with BRCC32 to produce the dcr file
4. Include the dcr file into the package source
5. Recompile/Install the package
To automate this, it is enough to add the BRCC32 command line into the package project "pre-build events". This way, you dcr file will be recreated before each build.
For a detailed description, see my blog at http://francois-piette.blogspot.be/2014/02/howto-create-dcr-file-for-your-delphi.html

Why would a module be unsavable until another module is loaded?

Most of the units I work on rely on a Data Module. One of the most annoying things I come accross is an error message telling me
Module X references another module and cannot be saved until Module Y is loaded.
Now, I'm sure there is a very good reason why CheckNoFixups raises this error while trying to WriteRootStream, and fails to save what is in effect a Text file (and hopefully this isn't followed by Catastrophic Failure where I must then restart the IDE while still unable to save my work.) but what is the good reason?
Why am I unable to click save without opening anothing text file containing various functions and objects much like any other unit? whats so special about a DataModule that means I can't save the source I'm working on until it's open, why aren't the 45 other units in the uses clause so important they must be open?
EDIT:
It's Delphi 2007
the Declaration of the DataModule is :
unit DataMD;
TRepDataMod = class(TDataModule)
...
var
RepDataMod: TRepDataMod;
If the DataModule is not part of the opened project the data aware objects in your form that reference the DataModule, cannot verify their reference and I think therefore the message comes up.
I only seen this message when I was porting an older project to a new Delphi version or were migrating to a new set of database components. In normal circumstances I haven't encountered this message.
In earlier versions I haven't seen the message and the form/unit could be saved, but the references that were in your dfm were magicly deleted.
I have the same issue (Delphi 7).
I have an imagelist on a datamodule for usage throughout the whole application. It happens after a compile, if there is an syntax error. The IDE opens the (pas) file and I can correct the error.
But trying to save the file shows that message ("Module 'XXX' links to module 'YYY' which cannot be found in the current project. Do you whish to remove/redirect the links to another module?"). XXX is the file itself and YYY is the datamodule. The datamodule is included in the project and answering "Yes" to that question would remove all links in the dfm file.
So the only solution is pressing "No", which basically saves the pas file and close the file in the - this time pressing "No" to the question if the file should be saved (the pas is in fact already saved).
I have allready tried various workarounds butstill struggling.
Module X references another module and cannot be saved until Module Y is loaded.
Just look over X.dfm (X.fmx) for "Y" entries. What to do with them, it's your choise.
Make sure DataModule is part of the project. Not enough just to include on search-path or enter into dpr-file manually. Go through IDE and add the DataModule to the project.
Also make sure the DataModule dfm-resource has the same name as the unit.

Resources