Difference between revisions of "Documentation/DevGuide/WritingUNO/C++/Write Registration Info Using a Helper Method"
From Apache OpenOffice Wiki
< Documentation | DevGuide
OOoWikiBot (Talk | contribs) m (FINAL VERSION FOR L10N) |
|||
Line 9: | Line 9: | ||
Use <code>::cppu::component_writeInfoHelper()</code> to implement <code>component_writeInfo():</code>. This function is called by ''regcomp'' during the registration process. | Use <code>::cppu::component_writeInfoHelper()</code> to implement <code>component_writeInfo():</code>. This function is called by ''regcomp'' during the registration process. | ||
<!--[SOURCE:Components/simple_cpp_component/service2_impl.cxx]--> | <!--[SOURCE:Components/simple_cpp_component/service2_impl.cxx]--> | ||
− | < | + | <syntaxhighlight lang="cpp"> |
extern "C" sal_Bool SAL_CALL component_writeInfo( | extern "C" sal_Bool SAL_CALL component_writeInfo( | ||
lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) | lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) | ||
Line 16: | Line 16: | ||
xMgr, xRegistry, ::my_sc_impl::s_component_entries ); | xMgr, xRegistry, ::my_sc_impl::s_component_entries ); | ||
} | } | ||
− | </ | + | </syntaxhighlight> |
Note that <code>component_writeInfoHelper()</code> uses the same array of <code>::cppu::ImplementationEntry</code> structs as <code>component_getFactory()</code>,that is, <code>s_component_entries</code>. | Note that <code>component_writeInfoHelper()</code> uses the same array of <code>::cppu::ImplementationEntry</code> structs as <code>component_getFactory()</code>,that is, <code>s_component_entries</code>. | ||
Latest revision as of 14:33, 24 December 2020
- Class Definition with Helper Template Classes
- Implementing your own Interfaces
- Providing a Single Factory Using a Helper Method
- Write Registration Info Using a Helper Method
- Provide Implementation Environment
- Implementing without Helpers
- Storing the Service Manager for Further Use
- Create Instance with Arguments
- Multiple Components in One Dynamic Link Library
- Building and Testing C++ Components
Use ::cppu::component_writeInfoHelper()
to implement component_writeInfo():
. This function is called by regcomp during the registration process.
extern "C" sal_Bool SAL_CALL component_writeInfo( lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) { return ::cppu::component_writeInfoHelper( xMgr, xRegistry, ::my_sc_impl::s_component_entries ); }
Note that component_writeInfoHelper()
uses the same array of ::cppu::ImplementationEntry
structs as component_getFactory()
,that is, s_component_entries
.
Content on this page is licensed under the Public Documentation License (PDL). |