Re: HText_setStyle

> 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 UTC