Click here to Skip to main content
15,910,009 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Synchronization and volatile Pin
CPallini1-Jan-08 21:03
mveCPallini1-Jan-08 21:03 
GeneralRe: Synchronization and volatile Pin
George_George1-Jan-08 21:19
George_George1-Jan-08 21:19 
GeneralRe: Synchronization and volatile Pin
Florin Crişan2-Jan-08 0:05
Florin Crişan2-Jan-08 0:05 
QuestionHow to use GetTimeZoneInformation Pin
CodingLover1-Jan-08 18:54
CodingLover1-Jan-08 18:54 
AnswerRe: How to use GetTimeZoneInformation Pin
CodingLover1-Jan-08 22:42
CodingLover1-Jan-08 22:42 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover2-Jan-08 0:05
CodingLover2-Jan-08 0:05 
QuestionRe: How to use GetTimeZoneInformation Pin
David Crow2-Jan-08 2:52
David Crow2-Jan-08 2:52 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover2-Jan-08 18:38
CodingLover2-Jan-08 18:38 
I do the enumerating as follows. How can I avoid the multiple findings. I mean, say there is more than one time zone for same time offset. In that case I want to display the very first time zone name. Used a break statement as follows. For some offsets it doesn't work.

for (i=0; i < cSubKeys; i++)
       {
           cbName = MAX_KEY_LENGTH;
           // Enumerate subkeys of Time Zones
           retCode = RegEnumKeyEx(hKey, i, achKey, &cbName, NULL, NULL, NULL, &ftLastWriteTime);

       // Make the new path for the registry
           char newPath[255];
           sprintf(newPath, "%s\\%s", path, achKey);
           printf("\n%s", newPath);

       // Work with the second handler
           if(RegOpenKey(HKEY_LOCAL_MACHINE, newPath, &hSubKey) == ERROR_SUCCESS)
           {
               if(RegQueryValueEx(hSubKey, "Display", 0, &dwType, (BYTE*)buf, &dwBufSize) == ERROR_SUCCESS)
               {
                   string strDisplay(buf);// Display name
                   string strSub = strDisplay.substr(4, 6);

               // String comparing
                   int result;
                   result = strcmp(strSub.c_str(), str.c_str());
                   if(result == 0)
                   {
                       printf("\n%s", strDisplay.c_str());// Time offset
                       break;
                   }

               }
               RegCloseKey(hSubKey);
           }
           else
           {
               printf("\nNo ");
           }
       }


I appreciate your help all the time...
Eranga Smile | :)

GeneralRe: How to use GetTimeZoneInformation Pin
dan o3-Jan-08 5:59
dan o3-Jan-08 5:59 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover3-Jan-08 14:23
CodingLover3-Jan-08 14:23 
GeneralRe: How to use GetTimeZoneInformation Pin
dan o3-Jan-08 21:36
dan o3-Jan-08 21:36 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover3-Jan-08 21:47
CodingLover3-Jan-08 21:47 
GeneralRe: How to use GetTimeZoneInformation Pin
dan o3-Jan-08 22:06
dan o3-Jan-08 22:06 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover3-Jan-08 22:10
CodingLover3-Jan-08 22:10 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover6-Jan-08 19:49
CodingLover6-Jan-08 19:49 
GeneralRe: How to use GetTimeZoneInformation Pin
dan o6-Jan-08 22:28
dan o6-Jan-08 22:28 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover6-Jan-08 22:39
CodingLover6-Jan-08 22:39 
GeneralRe: How to use GetTimeZoneInformation Pin
dan o6-Jan-08 23:10
dan o6-Jan-08 23:10 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover6-Jan-08 23:27
CodingLover6-Jan-08 23:27 
GeneralRe: How to use GetTimeZoneInformation Pin
dan o6-Jan-08 23:43
dan o6-Jan-08 23:43 
GeneralRe: How to use GetTimeZoneInformation Pin
CodingLover6-Jan-08 23:57
CodingLover6-Jan-08 23:57 
QuestionQuite similer application Pin
CodingLover7-Jan-08 18:33
CodingLover7-Jan-08 18:33 
GeneralRe: Quite similer application Pin
dan o8-Jan-08 1:05
dan o8-Jan-08 1:05 
GeneralSome API Pin
john56321-Jan-08 18:46
john56321-Jan-08 18:46 
GeneralRe: Some API Pin
Naveen1-Jan-08 18:52
Naveen1-Jan-08 18:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.