By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Get user Temp directory

P: n/a
Hi All,
I'm developping a DLL that requiers the path of the Temp directory of
the user logged. I used GetTempPath(), GetEnvironmentVariable() and
ExpandEnvironmentStrings(), but the 3 methodes returns the system temp
path: "C:\WINDOWS\Temp".
Did someone have another method or can explain me why it returns this
path instead of the user path "C:\Documents and Settings\user\local
settings\Temp".
Note:
When I used this 3 methods returns the right path in a Win32 console
application ?

Apr 13 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a

"Najd" <na************@yahoo.fr> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hi All,
I'm developping a DLL that requiers the path of the Temp directory of
the user logged. I used GetTempPath(), GetEnvironmentVariable() and
ExpandEnvironmentStrings(), but the 3 methodes returns the system temp
path: "C:\WINDOWS\Temp".
Did someone have another method or can explain me why it returns this
path instead of the user path "C:\Documents and Settings\user\local
settings\Temp".
Note:
When I used this 3 methods returns the right path in a Win32 console
application ?


You need to ask on a windows newsgroup. Check the news.microsoft.com server
for available groups. (Or do a search on Google... I'd bet it's been asked
and answered before.)

-Howard
Apr 13 '06 #2

P: n/a
Najd wrote:
I'm developping a DLL that requiers the path of the Temp directory of
the user logged. I used GetTempPath(), GetEnvironmentVariable() and
ExpandEnvironmentStrings(), but the 3 methodes returns the system temp
path: "C:\WINDOWS\Temp".
Whatever. Neither of those functions has anything to do with Standard
C++ language. I will take your word as to their behaviour.
Did someone have another method or can explain me why it returns this
path instead of the user path "C:\Documents and Settings\user\local
settings\Temp".
Yes, somebody in a Windows programming forum (newsgroup) undoubtedly has
some suggestions. Post there please. Here your question is off-topic.
Note:
When I used this 3 methods returns the right path in a Win32 console
application ?


Is that a question.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 13 '06 #3

P: n/a

Najd wrote:
Hi All,
I'm developping a DLL that requiers the path of the Temp directory of
the user logged. I used GetTempPath(), GetEnvironmentVariable() and
ExpandEnvironmentStrings(), but the 3 methodes returns the system temp
path: "C:\WINDOWS\Temp".


The C++ way to get the "TEMP" environment variable is
std::getenv("TEMP");
That works for me.

OT note: on some systems, the system temp path is the only temp path,
and C++ can't do anything about it. If the user wants it that way,
don't argue.

HTH,
Michiel Salters

Apr 14 '06 #4

P: n/a
Thanks.

Apr 17 '06 #5

P: n/a
Thanks Michiel.

Apr 17 '06 #6

P: n/a
Thank U.

Apr 17 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.