-#if defined(HAVE_DLOPEN)
-# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY)
-# define wxDllGetSymbol(handle, name) dlsym(handle, name.mb_str())
+#if defined(__WXPM__) || defined(__EMX__)
+# define INCL_DOS
+# include <os2.h>
+# define wxDllOpen(error, lib, handle) DosLoadModule(error, sizeof(error), lib, &handle)
+# define wxDllGetSymbol(handle, modaddr) DosQueryProcAddr(handle, 1L, NULL, (PFN*)modaddr)
+# define wxDllClose(handle) DosFreeModule(handle)
+#elif defined(HAVE_DLOPEN)
+# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_NOW/*RTLD_LAZY*/)
+# define wxDllGetSymbol(handle, name) dlsym(handle, name)