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

Exception: "Class 'TSplitter' not found " when creating form

0 views
Skip to first unread message

Tommi Prami

unread,
Jan 10, 2000, 3:00:00 AM1/10/00
to
HEllo

Exception: "Class 'TSplitter' not found" when creating form. when I put
Splitter component in somewhere on window then program works. When I remove
component (Coz there is not need for that component anymore) I can not use
that from. Exception is raised before execution reaches OnCreate event.

-Tommi-

Mike Orriss (TeamB)

unread,
Jan 10, 2000, 3:00:00 AM1/10/00
to
In article <85c52l$1v...@bornews.borland.com>, Tommi Prami wrote:
> Exception: "Class 'TSplitter' not found" when creating form. when I put
> Splitter component in somewhere on window then program works.
>

Add the following to the initialization section of the unit:

RegisterClasses([TSplitter]);

Mike Orriss (TeamB)
(Unless stated otherwise, my replies relate to Delphi 4.03/5.00)
(Unsolicited e-mail replies will most likely be ignored)


Craig Stuntz

unread,
Jan 10, 2000, 3:00:00 AM1/10/00
to
"Mike Orriss (TeamB)" wrote:
>
> In article <85c52l$1v...@bornews.borland.com>, Tommi Prami wrote:
> > Exception: "Class 'TSplitter' not found" when creating form. when I put
> > Splitter component in somewhere on window then program works.
>
> Add the following to the initialization section of the unit:
>
> RegisterClasses([TSplitter]);

That will certainly fix the symptom, but I'm not sure it's the
problem. If he does not have a TSplitter on his form, he shouldn't need
it.

I have encountered this error before when a form inherits from another
form, but when there is a third form with the same name as the second.
In other words, if you have units called MyParentForm.pas, MyForm.pas,
as follows:

unit MyParentForm

interface

uses
// whatever

type
TMyParentForm = class(TForm)
private
// etc.
end;

implementation // and so forth
end;

-----

unit MyForm

uses
// whatever

type
TMyForm = class(TMyParentForm)
private
// etc.
end;

implementation // and so forth
end;

----

...so far, all's well. But now imagine you have another directory in
the search path, with another unit called MyParent form, as follows:

unit MyParentForm

uses
// whatever

type MyParentForm = class(TForm)
Splitter1: TSplitter;
private
// etc.
end;

implementation // and so forth
end;

If the "second" MyParentForm is ahead of the "first" in the search
path, Delphi will try to instantiate an instance of TMyForm as a
subclass of the "second" TMyParentForm, including the splitter. But
since TMyForm "really" descends from the "first" TMyParentForm, the
splitter's unit is not in the uses clause.

This can happen if you copy files within a project without changing the
search path.

-Craig
--
Craig Stuntz cstuntz@no_spam.vertexsoftware.com
---------------- -----------------------------
Delphi Developer Vertex Systems Corporation
& Cat Wrangler http://www.vertexsoftware.com

Gabriel Forner

unread,
Jan 13, 2000, 3:00:00 AM1/13/00
to
I have sometimes experienced this problem with D5... and not necessarily with
the splitter class. Two ways I have discovered of fixing this (even though
they may not apply to you) is doing a save all before compiling. This fixes
the error when it's dealing with a 3rd party component. I have also had a
different situation with a 3rd party component where the fix was to rebuild
packages...

Good Luck,

Gabriel Forner
gfo...@fesoft.com

Tommi Prami wrote:

> HEllo


>
> Exception: "Class 'TSplitter' not found" when creating form. when I put

0 new messages