Difference between revisions of "Uno/Cpp/Snippet/FreeReference"
From Apache OpenOffice Wiki
m |
m (Splitted categories.) |
||
Line 11: | Line 11: | ||
... | ... | ||
} | } | ||
− | </code><noinclude>[[Category | + | </code><noinclude>[[Snippet]][[Category:Cpp]][[Category:Uno]]</noinclude> |
Revision as of 08:32, 29 November 2006
[cpp]
- include <cppu/EnvGuards.hxx>
... {
com::sun::star::uno::Reference<XFoo> ref(...) ... cppu::FreeReference<XFoo> free_xFoo(xFoo); cppu::EnvGuard otherEnv(cppu::Environment("just another env"));
free_xFoo->doSomething(); // the free reference ensures that the correct environment etc. gets activated before invokation ...
} Snippet