[Visual C++] How do you get a service to read environment variables?

I've tried both CString::GetEnvironmentVariable() and getenv(). They work fine when running as an exe but fail when running as a service. Is there any way around this?
Nevermind, the problem existed because I had the environment variable in the user section instead of the system section.
Topic archived. No new replies allowed.