The problem is that when I first load my project into Delphi 2007 and then
press F9 to compile it, any form that has a tab open in the IDE which
contains a Frame object will cause an error:
[DCC Error] E2161 Error: RLINK32: Error opening file "CharF.DFM"
If I just press F9 again, it will work, but will then give the same error on
the *next* form that is open in the editor. Once I have pressed F9 enough
times, it will then compile and run the project.
Once this happens, it never happens again, until I do a File/Close All and
reopen the project (or restart Delphi).
If I remember to click on each form tab in the IDE and select the Design
view to force each form to be displayed, then I do not get any errors.
I've seen some old reports in Google about something like this that is
apparently hard to reproduce. Unfortunately, my project is huge, so there
is no way for me to post it to Quality Central.
It's almost like some part of the IDE has the DFM file locked until it is
first accessed. This is on Vista Business edition. The files themselves
exist and the permissions are all properly set, so I don't think that is the
problem. These files are *not* on a network drive...they are on a local
drive. When I open the project in Delphi, it doesn't matter how long I wait
before hitting F9. I can wait an hour and press F9 and still get the RLINK
error the first time. So it's not something in the background that just has
the file locked for a short time or anything like that. I have looked in
the Vista Monitor tool which lists all of the files currently open by
applications on the system, and nobody has these DFM files open.
I am also using Castalia, Model Maker Explorer, and GExperts. But I have
disabled each of these and that hasn't made any difference either.
So I'm stumped. Yes, I can get around the problem by just hitting F9 again,
or by remembering to manually open each form in Design mode, but it's
getting to be a real annoyance. And the same project in Delphi 7 doesn't
have this problem.
Any advice is welcome.
When I reopen the project, the IDE reopens all of the forms I had open
when I closed the project. So far, so good. At this point, however,
trying to build or compile the project causes the E2161 error for one
of the forms. If I click on the tab for that form, and press F12, so
that the IDE 'shows' the design-time version of the form, then choose
to build or compile again, the problem moves on to another one of the
opened forms. Once I've been through all of the opened forms, the
project will compile/build properly.
It's as if, when the IDE reopens the forms, it has some initial kind of
lock on the file that prevents the compiler from accessing the file.
Displaying the form in the IDE window resolves this problem. The
complexity of the form doesn't seem to have any bearing on the problem
- it barfs on simple, 1-label-and-an-edit-box type forms just as much
as it does on complex, grids-and-loads-of-3rd-party-components type
forms.
As this isn't being reported with smaller projects (it would be obvious
to anyone if it was happening on small or even single-form projects), I
wonder if it's a resource or even file-handles issue of some sort.
I'm running the latest (and, mostly, greatest!) Delphi 2007 on a
virtualised Windows XP Pro SP 2 with plenty of ram and lots of disk
space. It was happening before the April hotfix, and I was hoping that
the April hotfix might have included a fix for this problem.
I guess I could stop Delphi from saving the project desktop/opened
forms etc when I close it, but to be honest in a large project that
kind of functionality becomes very useful and I'd much rather have a
good workaround or a fix than just stop using the function and having
to track-down and manually re-open all the things I was working on in
the last session.
As Zugg said - any advice or input would be most welcome, this problem
definitely takes some of the shine off of the (otherwise
mostly-positive) upgrade from D7 to D2007.
Cheers
Rob Uttley
Its likely to be one of the features that needs background compiling
that causes this. I've seen similar things on large projects too;
typically I have to wait until the first background compile has
finished before anything productive can be performed.
Does the problem go away if you wait a while so that any background
compiling has finished?
--
Eivind Bakkestuen
Nexus Database Systems Pty Ltd
On 2008-05-06 00:39:38 +0100, "Eivind Bakkestuen [NDD]"
I cycled F12/F12 (view form/view unit) for each open tab that would
have a DFM associated with it, and then tried to BUILD again - this
time with success.
It might actually be something to do with background compilation, but
leaving the machine to it's own ends for a while after loading the
project didn't seem to make any difference.
Good suggestion though! :-)
Cheers
Rob