git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2931 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
        @return A handle to the loaded DLL. Use success parameter to test if it is valid.
    */
    static wxDllType LoadLibrary(const wxString & libname, bool *success);
        @return A handle to the loaded DLL. Use success parameter to test if it is valid.
    */
    static wxDllType LoadLibrary(const wxString & libname, bool *success);
+   /** This function returns a valid handle for the main program
+       itself. */
+   static wxDllType GetProgramHandle(void);
    /** This function resolves a symbol in a loaded DLL, such as a
        variable or function name.
        @param dllHandle Handle of the DLL, as returned by LoadDll().
    /** This function resolves a symbol in a loaded DLL, such as a
        variable or function name.
        @param dllHandle Handle of the DLL, as returned by LoadDll().
 
 // ----------------------------------------------------------------------------
 
 #if defined(HAVE_DLOPEN)
 // ----------------------------------------------------------------------------
 
 #if defined(HAVE_DLOPEN)
-#   define wxDllOpen(lib)                dlopen(lib.fn_str(), RTLD_LAZY)
+#   define wxDllOpen(lib)                dlopen(lib.fn_str(), RTLD_NOW/*RTLD_LAZY*/)
 #   define wxDllGetSymbol(handle, name)  dlsym(handle, name.mb_str())
 #   define wxDllClose                    dlclose
 #elif defined(HAVE_SHL_LOAD)
 #   define wxDllGetSymbol(handle, name)  dlsym(handle, name.mb_str())
 #   define wxDllClose                    dlclose
 #elif defined(HAVE_SHL_LOAD)
 // wxDllLoader
 // ---------------------------------------------------------------------------
 
 // wxDllLoader
 // ---------------------------------------------------------------------------
 
+/* static */
+wxDllType
+wxDllLoader::GetProgramHandle(void)
+{
+#ifdef __WXGTK__
+   return dlopen(NULL, RTLD_NOW/*RTLD_LAZY*/);
+#else
+#pragma warning "Not implemented, please fix!"
+   return 0;
+#endif   
+}
+
+
 /* static */
 wxDllType
 wxDllLoader::LoadLibrary(const wxString & lib_name, bool *success)
 /* static */
 wxDllType
 wxDllLoader::LoadLibrary(const wxString & lib_name, bool *success)