Why does this work?

Mike L. mike.linford at gmail.com
Sat Jan 24 12:16:39 PST 2009


I saved and compiled the code given as getenv.d on the page http://www.digitalmars.com/d/archives/digitalmars/D/learn/623.html but I'm not entirely sure why it works.

The reasons that I don't understand it are:
1. GetEnvironmentStringsA() and the other functions aren't mentioned in std/c/windows/windows.d . and I can compile it with a simple "dmd getenv.d" without passing any other object files or libraries. If it's not in windows.d, why is windows.d even imported?

2. MSDN says that GetEnvironmentStringsA() returns LPTCH but getenv.d's version returns LPVOID.


More information about the Digitalmars-d-learn mailing list