--- /dev/null
+#include <cpPlugins/OS/DLLManager.h>
+#ifdef cpExtensions_OS_Windows
+#else // cpExtensions_OS_Windows
+# include <dlfcn.h>
+#endif // cpExtensions_OS_Windows
+
+// -------------------------------------------------------------------------
+void* cpPlugins::OS::DLLManager::
+Open( const std::string& filename )
+{
+ void* hnd = NULL;
+#ifdef cpExtensions_OS_Windows
+#else // cpExtensions_OS_Windows
+ hnd = dlopen( filename.c_str( ), RTLD_NOW | RTLD_GLOBAL );
+ char* error = dlerror( );
+ if( error != NULL )
+ throw std::runtime_error( error );
+#endif // cpExtensions_OS_Windows
+ return( hnd );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::OS::DLLManager::
+Close( void* hnd )
+{
+#ifdef cpExtensions_OS_Windows
+#else // cpExtensions_OS_Windows
+ /* TODO: why this clashes with VTK? -> Unregistering of factories.
+ dlclose( hnd );
+ dlerror( );
+ */
+#endif // cpExtensions_OS_Windows
+}
+
+// -------------------------------------------------------------------------
+void* cpPlugins::OS::DLLManager::
+Sym( void* hnd, const std::string& symbol )
+{
+ void* sym = NULL;
+#ifdef cpExtensions_OS_Windows
+#else // cpExtensions_OS_Windows
+ sym = dlsym( hnd, symbol.c_str( ) );
+ char* error = dlerror( );
+ if( error != NULL )
+ throw std::runtime_error( error );
+#endif // cpExtensions_OS_Windows
+ return( sym );
+}
+
+// eof - $RCSfile$