I do not get this error messe, please help :(


#1

hi there, maybe i’m too tired, but i do not get why i get this error:

error C2664: 'juce::TreeView::setRootItem': convert of Param 1 from  'ZoneGroup *' to 'juce::TreeViewItem *const ' not possible

(error message text translated from german, microsoft visual studio express 2005->
http://msdn.microsoft.com/en-us/library/s5b150wd(VS.71).aspx)

‘ZoneGroup’ inherits from ‘Zone’ wich inherits from ‘TreeViewItem’ , so ZoneGroup is/should be a ‘TreeViewItem’!? when ‘ZoneGroup’ inherits from ‘TreeViewItem’ directly, i get double inheritance confusion as expected :frowning:

i tried to brutaly cast it, but it gives me a runtime error of course :frowning:
i’m not use to the const pointer thing. i guess i have to do something in this direction. can you help me please?

thanks :slight_smile:

D3CK


#2

If you can’t force cast it, you don’t have a TreeViewItem.

Are you privately inheriting TreeViewItem?

Maybe post the declarations of Zone and ZoneGroup.


#3

[quote=“valley”]If you can’t force cast it, you don’t have a TreeViewItem.

Are you privately inheriting TreeViewItem?

Maybe post the declarations of Zone and ZoneGroup.[/quote]

shure…

Zone.h


class Zone : public juce::TreeViewItem, public juce::ChangeBroadcaster, public juce::SynthesiserSound {

ZoneGroup.h

i hoped i accedently inherited private, :frowning: no luck (i use a UML tool to generate the calss / function bodies, so i do not make erros in declarations mostly)

thanks so far :slight_smile:


#4

Does the cpp file that is having the error actually #include the definition of ZoneGroup, does does it just #include a forward declaration of the class?


#5

no :oops: ! it did it! thanks so much!! :smiley: :mrgreen: :o
thanks !!
merci!
danke!
cool!

D3CK

edit:
i did relay on the UML Tools generated code, it does handle most cases, but i keep an eye open now.