So what about the following approach:
Reference< XComponentContext > xContext =
::comphelper::getProcessComponentContext();
::cppu::ContextEntry_Init aContextInfo[] =
{
::cppu::ContextEntry_Init("testkey", uno::Any() ),
}
xNewContext = ::cppu::createComponentContext(aContextInfo,
sizeof(aContextInfo) / sizeof (aHandlerContextInfo[0]), xContext);
Then to get access to the container, I use something like this:
Reference< container::XNameContainer > xNameContainer( xContext, UNO_QUERY
);
Is this the right approach? Will the delegate ComponentContext work?
Chris
On Mon, Dec 1, 2014 at 12:25 AM, Andrew Pitonyak <[email protected]>
wrote:
> 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.
>
> Are you able to inspect an object to see of it supports setting values...
>
> I have done very little in this area and don't remember...
>
>
> Chris Sherlock <[email protected]> wrote:
>
> Hi all,
>
> How do you insert a value to be retrieved later into an XComponentContext
> reference?
>
> I see there is a XNameContainer, which is created by
> comphelper::NameContainer_createInstance(::cppu::UnoType<sal_Int32>::get())
> or whatever value you want. From here you then do insertByName.
>
> However, how do you then insert this into the component context?
>
> Chris
>
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice