Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4882703 By: tml1024
The approach I have taken in software I have ported to Windows is to have a DllMain() function (in case the software is a library, built as a DLL) store the HMODULE for the DLL, and then when pathnames for things like message catalogs or configuration files are needed, construct such pathnames at run-time, based on the location of the DLL as retrieved using GetModuleFileName() function. Typically, to minimize the impact on the source code, I then put in some header something like: #ifdef _WIN32 #undef FOO_SOMEDIR #define FOO_SOMEDIR _foo_win32_get_somedir() #endif Then the uses of FOO_SOMEDIR in the source code need not be ifdeffified. In order to support installing in folders with *any* Unicode characters in the path name, you should use the wide character version of the API, GetModuleFileNameW(). But typically libraries you use (like libintl) don't have any wide character versions of their functions, so then you need to get the short (8.3) version of path names, using GetShortPathNameW(). ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=74807 ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ GnuWin32-Users mailing list GnuWin32-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnuwin32-users