Results 1 to 5 of 5

Thread: TIP: How to deal with Delphi 7 "RLINK32: Error opening file "*.DFM"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Lightbulb TIP: How to deal with Delphi 7 "RLINK32: Error opening file "*.DFM"

    This is not a question but rather a TIP how to deal with problem i encountered yesterday and if somebody else has this rather "strange" error from nowhere then you at least could try it.
    Just wanted to give something back to this community.

    So my Windows was getting slow. I reformatted the HDD (just one partition where the Windows lives), installed new copy of it and also installed new copy of fresh Delphi 7 (Personal version in my case).

    Installed all the components i always use (TB2K, TBX, RXLib, etc, all free ones).

    Tried to open my map editor project and Delphi greeted me with message: "RLINK32: Error opening file "C:\Program Files\Borland\Delphi7\Projects\..\Main.DFM"

    I thought whats the problem, it just worked on old Windows. Few minutes ago.

    Ok, i started to look what Google has to say about this. And at one page of some discussion i found a tip something like: "some incompatible or not installed VCL component or image may cause that.."

    I tried to convert my .dfm to text format and binary, many many times with "DFM Editor from MiTeC" and later with "convert.exe", didn't help. I thought that it got corrupted somehow or something. But no..

    Then i started to look into text format .dfm file more carefully. Looked at the "binary" images i had there.
    Lot's of them.
    Then i noticed hmm, ImageList: "object ImageList1: TTBXImageList"
    And below that: "PngDIB = {"

    And then i kinda got it. That PngDIB...
    Delphi 7 doesnt support PNGs by default, that could be the problem.
    So i just removed everything between "PngDIB = {" and closing "}"

    All of the images. So i removed the image binary data, saved form and opened the project. Everything compiled and worked.
    My Delphi even started to show the main form again. I had to manually open it each time i wanted to see it.

    In my case i copy / pasted the ImageList's from TBX demo form to my editor form, because it had already nice images in it.

    So what could be the problem is that either the images are or went corrupted somehow either the TTBXImageList is buggy. Especially with PNGs.

    Sometimes it helps to change the "{$R *.DFM}" in your main unit to {$R Your_Main_Form.DFM} format.
    But not always. Delphi will not show the form like this later, if you press F12 (which i use alot, because its so quick). It will show the text version of form and that's it.

    So lesson i have learned is that, use .bmp as much as possible as images for your menus and toolbars.
    Bmp's can also get corrupted but they are supported by default in Delphi 7 and earlier versions of it. And should cause much less trouble.


    Hopefully this information is useful to someone.

  2. #2
    Delphi7 does not support PNG format by default but there was a freeware PNG library for it. So I gues that previously you also had that library instaled but lost it due to reformatting.

    NOTE: When formatting your computer it is always good to make backup of your Projects folder (of course), Delphi Lib folder (many components are installed into this folder) and Delphi source folder as some of hte components gets installed into this folder.

  3. #3
    After a similar experience (reformatting my rig many times), I decided to have all my sources in separated folder and manually install any component I may need. That way, I kept delphi faster and lighter. I also keep zips for anything related to sources, components and tools, and backups on rw dvds/memory sticks. Maybe it sounds crazy and obsesive, but never lost a working component/library again.

  4. #4
    @SilverWarrior: Yep, i used them but i dont remember what component exactly. Sometimes my projects just sit without any activity for long time and i forget easily what i have done or how and what i have used.

    Sorry, whats the "hte"?

    @pitfiend: what do you mean manually? I also install manually, not using any installer, just Component->Install Component.
    If you mean, you create them at runtime, then this is another story.

    Currently i have 3 partitions on my HDD. 1 for Win and other 2 for my stuff. So always before formatting i move projects folder from Delphi folder on C:\ part to my other partitions. Same with folder called Comp in Delphi 7 folder. In this Comp folder i hold all my used components. And then i just format the C: part, without touching others.

  5. #5
    Quote Originally Posted by hwnd View Post
    Sorry, whats the "hte"?
    That was ment to be "the".
    For some reason I'm making lots of spelling mistakes lately. Don't ask me why as I have no idea. But it is anoying as it hinders my programming productivity (I keep fixing errors in code due to my spelling mistakes).

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •