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

RegisterClass

345 views
Skip to first unread message

Stephen Diebel

unread,
Apr 2, 2001, 7:20:05 PM4/2/01
to
I want to use Streaming to save an object I create. (See sample code
below.)

RegisterClass gives me an error:
Incompatible types: 'tagWNDCLASSA' and 'Class reference'

What do I need to do?


Thanks,

SDiebel

TaClass = Class(TPersistent)
end;

initialization
RegisterClass(TaClass);

Xavier Pacheco (TeamB)

unread,
Apr 2, 2001, 9:03:59 PM4/2/01
to
I don't get that error at all in a small test app. Sounds like
something else is going on. Perhaps the TaClass is being redefined by
another unit?
-- x

Xavier Pacheco (TeamB)
Xapware Technologies Inc.
www.xapware.com
www.xapxone.com - Tips, search engine and articles

------------------------------------------------
Sorry but TeamB cannot answer support
questions received via email.

Robert Cerny

unread,
Apr 2, 2001, 8:39:25 PM4/2/01
to
Stephen Diebel wrote in message <3AC90924...@natc-ht.com>...

>I want to use Streaming to save an object I create. (See sample code
>below.)
>
>RegisterClass gives me an error:
>Incompatible types: 'tagWNDCLASSA' and 'Class reference'
>

Hm? RegisterClass can't give you this error. It's compiler that gives you
this error.

>
>TaClass = Class(TPersistent)
>end;
>
>initialization
>RegisterClass(TaClass);
>

Seems like you added "windows" into uses clause in implemetation section.
The solution is to either move "windows" into uses clause of interface
section or rename your class.

--
Robert


Alex Yackimoff

unread,
Apr 3, 2001, 4:19:39 AM4/3/01
to

Try this:

Classes.ReqisterClass(TaClass);

--
Alex Yackimoff


Roger Morton

unread,
Apr 3, 2001, 8:04:06 AM4/3/01
to
In <3AC90924...@natc-ht.com>, Stephen Diebel wrote:
>
> RegisterClass gives me an error:
> Incompatible types: 'tagWNDCLASSA' and 'Class reference'
>

Stephen

Try

Classes.RegisterClass(TaClass)

You've got Windows after Classes in your Uses clause. There are
duplicated declarations.

Roger Morton
roger....@bigfoot.com

Ron Davis

unread,
Apr 4, 2001, 12:47:43 PM4/4/01
to
This problem cropped for me when I added "Windows" to the uses clause. I
got rid of the error by using "Classes.RegisterClass" instead of just
"RegisterClass".


Stephen Diebel wrote:

--
Ron Davis
Custom Software Engineering


Colin Wilson

unread,
Apr 5, 2001, 7:55:43 AM4/5/01
to
'windows.pas' has a function called RegisterClass that conflicts with
the VCL one.

Just make sure that 'windows' is the *first* thing in your uses list.
If you say:

uses Classes, SysUtils, Windows

you will get the problem you're seeing.

But if you say:

uses Windows, Classes, SysUtils

The problem will go away.

Colin
e-mail :co...@wilsonc.demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm

Robert Surcouf

unread,
May 17, 2021, 4:52:21 AM5/17/21
to
Thank you Colin. You're so right. It worked for me.
0 new messages