W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1996

Re: HText_setStyle

From: Sacha <sacha@clip.dia.fi.upm.es>
Date: Thu, 20 Jun 1996 10:27:11 +0200
To: mesexp@di.uminho.pt
Cc: www-lib@w3.org
Message-Id: <31C90B5F.167EB0E7@dia.fi.upm.es>
> Hi,
> 
> I'm trying to use webbot and adapt it my own way. I must say the 
> Library code is really complex, though it has great potentialities.I 
> just regret the fact it's not implement in C++.
> 
> One of the problems I have is when I try to use the callback function
>         HText_setStyle(Htext *text, HTStyle *style)
> and try to access one of the fields in 'style' the compiler returns 
> the error message:
>         invalid use of undefined type 'struct _HTStyle'.
> 
> Could someone please help me out to solve the problem.
> Thanks in advance
> --



Hmmm...

This sounds a lot like the weird "dereferencing pointer to incomplete
type" errors gcc was giving me. I think the problem is that struct
_HTStyle (like struct _HTStream) is not defined in any header file. My
analysis was that this is because of the lib's pseudo C++ system; by not
defining _HTStyle, you can redefine it in any subclass of HTStyle
[Eric?], just like _HTStream is redefined in all the different stream
modules.

Anyway, try putting

	struct _HTStyle {};

somewhere near the top of your file.

This probably will cause problems if you are allocating HTStyles or
accessing fields in the HTStyle (I haven't used styles, so I can't say).

Also, have a look at the C/C++ Style document at w3's web site, maybe it
says something about this.


Later,

Sacha.

-- 
"ABORIGINIES, n.  Persons of little worth found cumbering the soil of a 
 newly discovered country.  They soon cease to cumber; they fertilize."
-----> from `The Devil's Dictionary' by Ambrose Bierce
Received on Thursday, 20 June 1996 04:28:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:26 GMT