Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

EClassNotFound exception

1 view
Skip to first unread message

Jimmy Rasmussen

unread,
Aug 2, 2005, 10:40:43 AM8/2/05
to
Hi all,

I've had some trouble trying to compile one of my old projects. One of the
files had a reference to "TreeViewMap" in it's uses clause, and compilation
failed since the TreeViewMap.dcu file could not be found. (I think it might
some class I once wrote, but I'm not sure :-) ). I tried to remove the entry
in the uses clause which didn't help since the entry reappears by itself
whenever I save the file or compile the project. As a final act of
frustration I added a TreeViewMap.pas file with an "empty" TTreeViewMap
class inside, which makes it possible to compile the project, but
unfortunately an EClassNotFound exception (it can't find the TTreeViewMap
class) is raised when I try to run it.

What's going on?

regards
Jimmy


Rob Kennedy

unread,
Aug 2, 2005, 12:16:38 PM8/2/05
to
Jimmy Rasmussen wrote:
> I've had some trouble trying to compile one of my old projects. One of the
> files had a reference to "TreeViewMap" in it's uses clause, and compilation
> failed since the TreeViewMap.dcu file could not be found. (I think it might
> some class I once wrote, but I'm not sure :-) ). I tried to remove the entry
> in the uses clause which didn't help since the entry reappears by itself
> whenever I save the file or compile the project.

That means that you do in fact have that unit. It's provided by a
component package that you have installed, and on your form you have a
component that is declared in that unit. When you save a file, Delphi
looks through your DFM and form declaration to determine what units are
required to make the form loadable. (It will only add units, not remove
them.)

If the compiler can't find the unit when it tries to compile your code,
then you need to make sure that the file is in a place that's mentioned
on your Delphi library path. Look in the option dialog to set that path.
(The exact location has changed in different Delphi versions, so do a
little exploring to find it for yourself.)

--
Rob

0 new messages