Mail Archives: cygwin/1999/04/27/15:58:17
Consider following code, where lpszModuleName is //c/test/somedll.dll
which requires //c/test/anotherdll.dll to function.
if(pathvar = getenv("PATH")) {
char * dir = alloca(strlen(lpszModuleName)+1);
char * tmppath = alloca(strlen(dir)+strlen(pathvar)+1);
strcpy(dir, lpszModuleName);
dir = dirname(dir);
strcpy(tmppath, "PATH=");
strcat(tmppath, dir);
/* this line is for future automatic recognition */
strcat(tmppath, strstr(pathvar,"/") ? ":" : ";");
strcat(tmppath, pathvar);
putenv(tmppath);
}
WinModuleName = pathFromUnixToWin(lpszModuleName);
hMod = LoadLibrary(WinModuleName);
The LoadLibrary fails in this case. If I compile the same code using
-mno-cygwin changing putenv to _putenv (as told by msvc++ help),
replacing contents of lpszModuleName with c:\test\somedll.dll and
removing call to pathFromUnixToWin everything works fine.
Any ideas of how to call Win32 versions of getenv/_putenv instead of
cygwin ones?
Eugene.
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -