<div dir="ltr">OK, I've worked it out. What happens is that <span style="font-family:arial,sans-serif;font-size:13px">comphelper::</span><span style="font-family:arial,sans-serif;font-size:13px">getProcessComponentContext() is actually getting the concrete class ComponentContext, which implements XNameContainer and XContainerContext. </span><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">All you need to do is to instantiate a new Reference< XNameContainer > like so:</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Reference< container::XNameContainer > xNameContainer( xContext, UNO_QUERY );</span><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">You can then insert and remove properties at will. </span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Chris</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 11:31 AM, Andrew Pitonyak <span dir="ltr"><<a href="mailto:andrew@pitonyak.org" target="_blank">andrew@pitonyak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No stress on the number of mails.<br><br>I did not think that you could change a context after it was created... But I would certainly try if I had a need. I know very little about this specifically.<br><br>Chris Sherlock <<a href="mailto:chris.sherlock79@gmail.com" target="_blank">chris.sherlock79@gmail.com</a>> wrote:<br><br><div dir="ltr"><span class=""><div>Oh, and sorry for the number of emails, but I guess I'm assuming that you can add a new property key at any point by insertByName()... </div><div><br></div><div>Thanks in advance, UNO is a little tricky at this level. At least that's what I find... from what I can tell, it really comes down to the cppuhelper::ComponentContext class which implements the XNameContainer interface. *Please* correct me if I'm wrong :-)</div><div><br></div></span><div>Chris</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 10:29 AM, Chris Sherlock <span dir="ltr"><<a href="mailto:chris.sherlock79@gmail.com" target="_blank">chris.sherlock79@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>So what about the following approach:</div><div><br></div><div>Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();<br>::cppu::ContextEntry_Init aContextInfo[] =<br>{<br>    ::cppu::ContextEntry_Init("testkey", uno::Any() ),<br>}</div><div>xNewContext = ::cppu::createComponentContext(aContextInfo, sizeof(aContextInfo) / sizeof (aHandlerContextInfo[0]), xContext);</div><div><br></div><div>Then to get access to the container, I use something like this:</div><div><br></div><div>Reference< container::XNameContainer > xNameContainer( xContext, UNO_QUERY );</div><div><br></div><div>Is this the right approach? Will the delegate ComponentContext work?</div><span><font color="#888888"><div><br></div><div>Chris</div><div><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 12:25 AM, Andrew Pitonyak <span dir="ltr"><<a href="mailto:andrew@pitonyak.org" target="_blank">andrew@pitonyak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">Guessing from memory and not east for me to verify at the Moment, but I thought that the context was read only. I think that of you want to add values you need to create a new one with the desired named value pairs.<br><br>Are you able to inspect an object to see of it supports setting values... <br><br>I have done very little in this area and don't remember...<div><div><br><br>Chris Sherlock <<a href="mailto:chris.sherlock79@gmail.com" target="_blank">chris.sherlock79@gmail.com</a>> wrote:<br><br><div dir="ltr">Hi all, <div><br></div><div>How do you insert a value to be retrieved later into an XComponentContext reference?</div><div><br></div><div>I see there is a XNameContainer, which is created by comphelper<span style="color:rgb(0,0,0)">::</span><a name="14a034216e661c47_14a0309bdd1383ce_14a00e07d31c20b8_NameContainer_createInstance" style="color:rgb(153,0,153);font-style:italic;font-weight:bold"></a>NameContainer_createInstance(::cppu::UnoType<sal_Int32>::get()) or whatever value you want. From here you then do insertByName. </div><div><br></div><div>However, how do you then insert this into the component context?</div><div><br></div><div>Chris</div></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>