Need some help with updating an old code

Hello there,

I am currently trying to update the old code of a rendering-software for the wave-field-synthesis system at our university. Inside a MainComponent method called saveProject() the following lines of code:

    // create device element and add it to main node
XmlElement* audioDeviceNode = _audioDeviceManager.createStateXml();
    mainNode.addChildElement(audioDeviceNode);

give me the following errror message:

Error C2440 ‘initializing’: cannot convert from ‘std::unique_ptr<juce::XmlElement,std::default_deletejuce::XmlElement>’ to ‘juce::XmlElement *’

I’d be super glad if somebody could give me a hint what the reason for that could be.

Cheers,
Christian

auto audioDeviceNode = _audioDeviceManager.createStateXml();
mainNode.addChildElement(audioDeviceNode.release());

as createStateXml nows return a std::unique_ptrjuce::XmlElement

1 Like

Yeah! Thank you so much for the fast response!!