Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Registry Values Problm Plz hlp me

Registry Values Problm Plz hlp me

Scheduled Pinned Locked Moved C / C++ / MFC
databasewindows-admin
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zeeshan Bilal
    wrote on last edited by
    #1

    HI ,, I m Storing Value in Registry as String Value in Windows 2000 / XP its store string value without double qoutes"" as... value but in Window 98 it Save String Value with in qoutes... "value" then after query a value then i try to mathc it but there is missmatch in Windows 98 due to " .." . y any solution. thanx

    T 1 Reply Last reply
    0
    • Z Zeeshan Bilal

      HI ,, I m Storing Value in Registry as String Value in Windows 2000 / XP its store string value without double qoutes"" as... value but in Window 98 it Save String Value with in qoutes... "value" then after query a value then i try to mathc it but there is missmatch in Windows 98 due to " .." . y any solution. thanx

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      hian don't mind,i think you are wrong. i am working on registry i have never this problem which you stating. anyway what are using raw API's or CRegClass ----------------------------- "I Think It will Work" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

      Z 3 Replies Last reply
      0
      • T ThatsAlok

        hian don't mind,i think you are wrong. i am working on registry i have never this problem which you stating. anyway what are using raw API's or CRegClass ----------------------------- "I Think It will Work" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

        Z Offline
        Z Offline
        Zeeshan Bilal
        wrote on last edited by
        #3

        HI i m using CRegKey Class.... and its methods for query etc. Can u send me any code sampl ,, that can work on both win 98 and win 2000/ XP but if u see using regedit command too see registry values in windows 98 .. or 2000/ Xp. check there any registry value that is string value in win 98 its as "value" but in XP and 2000 its as value simply without qoutations"". thanx

        T 1 Reply Last reply
        0
        • T ThatsAlok

          hian don't mind,i think you are wrong. i am working on registry i have never this problem which you stating. anyway what are using raw API's or CRegClass ----------------------------- "I Think It will Work" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

          Z Offline
          Z Offline
          Zeeshan Bilal
          wrote on last edited by
          #4

          I think the Problm in Query to the key here CRegKey reg; CString str = "cam"; BOOL bRetVal; CString strTmp = "Software\\NDT\\Fovea"; bRetVal = reg.Open (HKEY_LOCAL_MACHINE ,(LPCTSTR)strTmp ) ; if (bRetVal==ERROR_SUCCESS) { CString key = "Password"; char getValue[256] ; DWORD d; bRetVal=reg.QueryValue ( getValue , (LPCTSTR)key , &d); if (bRetVal==ERROR_SUCCESS) { AfxMessageBox(" Working fine"); CString check = (CString)getValue ; AfxMessageBox( "Value is ....||"+ check); if (str.Compare (check) == 0) { AfxMessageBox( "Same"); reg.Close (); } else { AfxMessageBox( "Not same"); reg.Close (); } } else AfxMessageBox(" Query Failed"); } else { AfxMessageBox( "Cannot Open"); reg.Close (); } It is messaging Query Failed..

          1 Reply Last reply
          0
          • T ThatsAlok

            hian don't mind,i think you are wrong. i am working on registry i have never this problem which you stating. anyway what are using raw API's or CRegClass ----------------------------- "I Think It will Work" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

            Z Offline
            Z Offline
            Zeeshan Bilal
            wrote on last edited by
            #5

            I think the Problm in my Query to the key here CRegKey reg; CString str = "cam"; BOOL bRetVal; CString strTmp = "Software\\NDT\\Fovea"; bRetVal = reg.Open (HKEY_LOCAL_MACHINE ,(LPCTSTR)strTmp ) ; if (bRetVal==ERROR_SUCCESS) { CString key = "Password"; char getValue[256] ; DWORD d; bRetVal=reg.QueryValue ( getValue , (LPCTSTR)key , &d); if (bRetVal==ERROR_SUCCESS) { AfxMessageBox(" Working fine"); CString check = (CString)getValue ; AfxMessageBox( "Value is ....||"+ check); if (str.Compare (check) == 0) { AfxMessageBox( "Same"); reg.Close (); } else { AfxMessageBox( "Not same"); reg.Close (); } } else AfxMessageBox(" Query Failed"); } else { AfxMessageBox( "Cannot Open"); reg.Close (); } It is messaging Query Failed..

            T 1 Reply Last reply
            0
            • Z Zeeshan Bilal

              I think the Problm in my Query to the key here CRegKey reg; CString str = "cam"; BOOL bRetVal; CString strTmp = "Software\\NDT\\Fovea"; bRetVal = reg.Open (HKEY_LOCAL_MACHINE ,(LPCTSTR)strTmp ) ; if (bRetVal==ERROR_SUCCESS) { CString key = "Password"; char getValue[256] ; DWORD d; bRetVal=reg.QueryValue ( getValue , (LPCTSTR)key , &d); if (bRetVal==ERROR_SUCCESS) { AfxMessageBox(" Working fine"); CString check = (CString)getValue ; AfxMessageBox( "Value is ....||"+ check); if (str.Compare (check) == 0) { AfxMessageBox( "Same"); reg.Close (); } else { AfxMessageBox( "Not same"); reg.Close (); } } else AfxMessageBox(" Query Failed"); } else { AfxMessageBox( "Cannot Open"); reg.Close (); } It is messaging Query Failed..

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #6

              Here is your Problem Zeeshan Bilal wrote: CString key = "Password"; char getValue[256] ; DWORD d; bRetVal=reg.QueryValue ( getValue , (LPCTSTR)key , &d); remeber one thing,QuerryValue Third Parameter containing values goes Both IN and Out so if you want to run your Program properly change DWORD d; to DWORD d=255;//one space for null character ->Basically when the function is Called, the DWORD value Must contain the buffer size of string (which is going in as Second parameter for fetching required Value). ->when function return it contain the value for Total data in second Parameter Return . ----------------------------- "I Think It will Work" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

              1 Reply Last reply
              0
              • Z Zeeshan Bilal

                HI i m using CRegKey Class.... and its methods for query etc. Can u send me any code sampl ,, that can work on both win 98 and win 2000/ XP but if u see using regedit command too see registry values in windows 98 .. or 2000/ Xp. check there any registry value that is string value in win 98 its as "value" but in XP and 2000 its as value simply without qoutations"". thanx

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #7

                IS your Problem Solved :doh: ----------------------------- "I Think It will Work" Formerly I AM Known As "Alok The Programer" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups