diff options
Diffstat (limited to 'odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx')
-rw-r--r-- | odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx index 820d96f83c46..07f2b5712970 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx @@ -32,6 +32,7 @@ * *************************************************************************/ +#include <sal/types.h> #include "SDriver.hxx" #include <cppuhelper/factory.hxx> #include <osl/diagnose.h> @@ -55,8 +56,8 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) //*************************************************************************************** // -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. +// The required C-Api must be provided! +// It contains of 3 special functions that have to be exported. // //--------------------------------------------------------------------------------------- @@ -118,7 +119,7 @@ struct ProviderRequest //--------------------------------------------------------------------------------------- -extern "C" void SAL_CALL component_getImplementationEnvironment( +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, uno_Environment **ppEnv ) @@ -126,33 +127,36 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } +// This method not longer necessary since OOo 3.4 where the component registration was +// was changed to passive component registration. For more details see +// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration //--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - SkeletonDriver::getImplementationName_Static(), - SkeletonDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "SKELETON::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} +// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( +// void* pServiceManager, +// void* pRegistryKey +// ) +// { +// if (pRegistryKey) +// try +// { +// Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); + +// REGISTER_PROVIDER( +// SkeletonDriver::getImplementationName_Static(), +// SkeletonDriver::getSupportedServiceNames_Static(), xKey); + +// return sal_True; +// } +// catch (::com::sun::star::registry::InvalidRegistryException& ) +// { +// OSL_ENSURE(sal_False, "SKELETON::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); +// } + +// return sal_False; +// } //--------------------------------------------------------------------------------------- -extern "C" void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey) |