# Need some help with updating an old code

**URL:** <https://forum.juce.com/t/need-some-help-with-updating-an-old-code/42198>\
**Category:** Windows\
**Created:** [October 13, 2020, 8:03am UTC](https://forum.juce.com/t/need-some-help-with-updating-an-old-code/42198 "2020-10-13T08:03:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christianscheer](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/christianscheer/32/10068_2.png) [@christianscheer](https://forum.juce.com/u/christianscheer)\
**Post date:** [October 13, 2020, 8:03am UTC](https://forum.juce.com/t/need-some-help-with-updating-an-old-code/42198/1 "2020-10-13T08:03:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 13, 2020, 8:11am UTC](https://forum.juce.com/t/need-some-help-with-updating-an-old-code/42198/2 "2020-10-13T08:11:14Z")

</div>

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

```

as createStateXml nows return a std::unique\_ptrjuce::XmlElement

---

<div class="post-metadata">

**Author:** ![christianscheer](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/christianscheer/32/10068_2.png) [@christianscheer](https://forum.juce.com/u/christianscheer)\
**Post date:** [October 13, 2020, 8:15am UTC](https://forum.juce.com/t/need-some-help-with-updating-an-old-code/42198/3 "2020-10-13T08:15:10Z")

</div>

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