|
WindowsPistha wrote: Advice me about the correct way to get the Currently logged in users profile directory.
Maybe use SHGetFolderPath(), or on Vista+ only, SHGetKnownFolderPath().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Both i tried SHGetFolderPath(), or on Vista+ only, SHGetKnownFolderPath().
Both gives administrator profile directory only, if elevated.
modified on Thursday, October 30, 2008 2:42 PM
|
|
|
|
|
WindowsPistha wrote: Both gives administrator profile directory only, if elevated.
What did you use as the fourth argument (i.e., dwFlags ) to SHGetFolderPath() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I used SHGFP_TYPE_CURRENT flag that also gives me the elvated users app data path.
modified on Friday, October 31, 2008 6:36 AM
|
|
|
|
|
Have you tried SHGFP_TYPE_DEFAULT to see if it yields anything different?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
Thanks !
I have red the link.
SHGetKnownFolderPath also gives me the admin users appdata path.
Not the currently windows logged in users appdata path.
|
|
|
|
|
Hi, my problem is I want to add an array containing some null bytes at the beginning of it, to a std::string like this:
std::string MyString = "\x00\x00\x01\x02";// "It won't copy anything into MyString but...
std::string MyString2 = "\x01\x00\x03"; // Will copy the array includiing the null byte and whats after it.
What should I do? Thanks
|
|
|
|
|
I think Ill reply to myself:
There is a constructor for what I want and it is:
string ( const char * s, size_t n );
Anyway, do you think it can give me some kind of problem using std::strings for byte array handling? Thanks
|
|
|
|
|
santiageitorx wrote: do you think it can give me some kind of problem using std::strings for byte array handling?
The class is named string , what do you think?
You might want to pick up a copy of Kent Becks book, Implementation Patterns.
led mike
|
|
|
|
|
led mike wrote: The class is named string, what do you think?
This [^], maybe.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
santiageitorx wrote: std::string MyString = "\x00\x00\x01\x02";// "It won't copy anything into MyString but...
What if you used wstring instead?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I am making a program in MFC.The main frame take the charge of moniting,if the specified event occured,a short message will be sent.At the same time,I will moniting if there is a new short message had come,if it had,I will do someting with the message.So in the situation above,what should I prefer?The timer or the thread? I am a newer in MFC.Thanks!
|
|
|
|
|
Your description is a bit involved. Could you please elaborate and clarify?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
For example the program is used for sending a mobile short message when a button is clicked,at the same time, the backstage is used for checking if there is a new short message had come every three minutes.I mean how I deal with the backstage.Set a timer or make a thread?
|
|
|
|
|
lingerpop wrote: the backstage is used for checking if there is a new short message had come every three minutes.
Since the background operation have to be done in every 3 minutes, timer is inevitable. Your real concern is - which one to use? "Simple mfc message timer" or "thread + timer" ? Well, my suggestion is, if your background operation is time consuming, go for Thread+Timer , or else simple WM_TIMER message will do, since it won't block the GUI.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Does anyone know of a wrapper to CProgressCtrl that accepts __int64 values?
|
|
|
|
|
Seeing how the progress control can only show progress one pixel at a time, and the win32 progress bar control already has a range of 0 to 65535 (a short) which is way more than could ever possibly be shown on a display screen, creating a wrapper to accept __int64 values would be fairly simple. Just a little bit of division to get the number into the proper range.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Can you make your range be between 0 and 100 percent?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Can Somebody Please tell me how to
Read and Write INI file ....
If possible send me some samples too
|
|
|
|
|
|
|
|
Also here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Is it easier to create INI file in REGISTRY
then READ/WRITE TO it?
|
|
|
|