Retrieving MS-DOS Environment Vars from a Windows DLL (78542)
The information in this article applies to:
- Microsoft Windows Software Development Kit (SDK) 3.0
- Microsoft Windows Software Development Kit (SDK) 3.1
This article was previously published under Q78542 SUMMARY
The C run-time library function getenv() does not work when called
from a Windows dynamic-link library (DLL). MS-DOS environment variables
can be found by searching the environment block. This article explains
a method to retrieve information from environment variables.
NOTE: In Visual C++ version 1.0, getenv() does work correctly as long
as you do not link in LIBENTRY.OBJ (you need the default library
version that initializes the run time) and mark your DLL function as
_export to correctly load DS.
Modification Type: | Major | Last Reviewed: | 10/29/2003 |
---|
Keywords: | kb16bitonly KB78542 |
---|
|