|
what! no replies!
Anyway the problem is solved.
in the line
GetToolBarCtrl().AddButtons(iButtonCount+iSeptratorCount, pAToolBarButton);
pAToolBarButton is an array of TBBUTTON structure where each structure represents a button on the tool bar.
It seems that each field in TBBUTTON structure must be properly initialized in Vista. Well this is a good programming practice anyway.
But in case you have left the less used fields like TBBUTTON.dwValue uninitialized, it would ignored when you application runs on XP.
Where as in Vista you get an exception when you try to add the buttons to your toolbar control.
only dead fish swim with the stream
|
|
|
|
|
Can any one of you help me how to implement a MD5 algorithm in C++
Thanks
Nandu
|
|
|
|
|
Surely you jest:
I could do this if I only had a search engine
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
RFC-1321 describes the MD5 steps and includes the original reference implmentation.
http://www.rfc.net/rfc1321.html[^]
I assume you want to do this for educational purposes. Otherwise it would be better to use Microsoft cryptographic service providers.
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks for your prompt reply.
-Nandu
|
|
|
|
|
|
With the above link i am able to ecoding, but can any help me to decoding it.
Thanks
-Nandu
|
|
|
|
|
Nandu_77b wrote: any help me to decoding it
MD5 is a hash, it only goes from plain-text to hashed data. It does not go the other way. If you want to go back and forth, you need to look at cryptography, not hashing.
Judy
|
|
|
|
|
HI
Any can help me, to get the users home directory in windows. Is there any win32 API avilable for it?
Home directory means ::C:\Documents and Settings\<userid>
Please help with possible ways to get this thro program.
Thanks,
Nandu
|
|
|
|
|
Home dir:C:\Documents and Settings\userid
|
|
|
|
|
|
You could also use GetEnvironmentVariable:
TCHAR tcDirName[_MAX_PATH];
GetEnvironmentVariable(_T("userprofile"), tcDirName, _MAX_PATH);
This environment variable is set when the user logs on.
Note that it is not always on the same drive as the system (C .
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thanks for your reply, is there any specific win32 API who will do this job. As i need to use this in win32 API programming, not in MFC or higher framwork.
-Nandu
|
|
|
|
|
That is Win32 API call.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Nandu_77b wrote: is there any specific win32 API who will do this job
Yes, use
GetUserProfileDirectory - retrieves the path to the root directory of the specified user's profile.
For e.g. C:\Documents and Settings\Nibu
A function which uses ths API to return current process user home dir...
#include "Userenv.h"
#pragma comment(lib, "userenv.lib")
CString GetUserHomeDir()
{
TCHAR szHomeDirBuf[MAX_PATH] = { 0 };
HANDLE hToken = 0;
VERIFY( OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &hToken ));
DWORD BufSize = MAX_PATH;
VERIFY( GetUserProfileDirectory( hToken, szHomeDirBuf, &BufSize ));
CloseHandle( hToken );
return CString( szHomeDirBuf );
}
Then there are other functions too which might interest you, like...
GetAllUsersProfileDirectory
GetDefaultUserProfileDirectory
GetProfilesDirectory
Look up these in MSDN for more information.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
modified on Wednesday, June 4, 2008 11:55 PM
|
|
|
|
|
Is the given code correct?
I am wondering about the return instruction, in which a CString object is created:
return CString( szHomeDirBuf );
In my opinion this object will be already destroyed while the function returns.
When accessing from caller, the object is already invalid.
CString res = GetUserHomeDir();
Am I wrong?
|
|
|
|
|
Hi
How to get User's gateway IP using VC++ ?.
Is there any VC++ API to find the IE Version ?.
Thanks in advance.
Prabhat Singh
|
|
|
|
|
Use GetAdaptersInfo() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can somebody tell me the best book to start with COM&ATL Stuff?
|
|
|
|
|
Aseem Sharma wrote: tell me the best book
Well I think books can be somewhat personal but for me it was this one.[^]
led mike
|
|
|
|
|
Inside COM - Dale Rogerson
Sudhir Kumar
|
|
|
|
|
|
|
hi, well, im currently using visual studio 2003 to compile or attempt to compile a Half life 2, AKA. a source mod, but i get 2 errors and im having trouble getting rid of them so i can compile the *.dll file, i get these errors as follows:
Error C2062: Type 'void' unexpected
Error C2447: '{': missing function header (old-style formal list?)
the code seems to be correct and should work but those 3 errors are prohibiting me from compiling the *.dll file, any help would be great apreaciated.
(i have attached the small block of code that the errors point too)
CWeaponDualies( void )
{
m_flSoonestPrimaryAttack = gpGlobals->curtime;
m_flAccuracyPenalty = 0.0f;
m_fMinRange1 = 24;
m_fMaxRange1 = 1500;
m_fMinRange2 = 24;
m_fMaxRange2 = 200;
m_bFiresUnderwater = true;
}
modified on Wednesday, June 4, 2008 9:17 AM
|
|
|
|
|
What happens when you remove void ?
|
|
|
|