Debug build problem : draganddropcontainer


#1

okay, i’ve just tried for the first time to implement drag and drop. i’ve inherited DragAndDropContainer and Component into my main component class, and this is what i get when i try to build a debug version:

error C2385: ambiguous access of 'new’
could be the ‘new’ in base 'juce::Component’
or the ‘new’ in base ‘juce::DragAndDropContainer’

error C2385: ambiguous access of 'delete’
could be the ‘delete’ in base 'juce::Component’
or the ‘delete’ in base ‘juce::DragAndDropContainer’

any ideas? anyone encountered this before?


#2

just add the juce_UseDebuggingNewOperator macro to your class definition…


#3

ahh! of course, sorry for being a knob! it didn’t occur to me that i could put one in there, i thought i’d have to delete that one from the dndcontainer…

<-- idiot! thanks jules


#4

no, you’re not an idiot, it’s not very obvious what’s going on with that bug.


#5

perhaps it would be good to add an extra note to the docu for that macro. that’s the first place i looked, but it just says that it’s used a lot.

Something along the lines of…

“Because many juce classes make use of this macro, you may find ambiguities when deriving from multiple classes (an example would be Component and DragAndDropContainer). If this happens, simply include this macro in the public section of your subclass declaration.”

of course, now there’s a thread that mentions this macro, new users can always use the search function! :wink:


#6

[EDIT] sorry, it’s true i am an idiot - in trying to fix the bug i removed the DragAndDropContainer derivation from the parent component. dumbass! fixed and working a treatz0rs


#7