How to search and reteieve the value of a key in the registry-VC++

Discussion in 'MFC' started by Athish, Feb 19, 2007.

  1. Athish

    Athish New Member

    Joined:
    Feb 19, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    How to search and reteieve the value of a key in the registry through VC++ Application??
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Open Main Key with RegOpenKeyEx and get the necessary value with RegQueryValueEx API's
     
  3. Athish

    Athish New Member

    Joined:
    Feb 19, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    thanks for your reply shabbir..

    i have one more query....kindly read the below one,


    How to retrieve the ORACLE_HOME location from the Registry Editor through VC++ application, irrespective of the Oracle Version(either 9i or 10 G)??

    Because, the ORACLE_HOME resides in different folders w.r.to the oracle version.

    Currently, we are using a MFC function (RegOpenKeyEx()) to retrieve the ORACLE_HOME Location but this function requires the Complete folder path (For Instance,., SOFTWARE\\ORACLE for Oracle 9i and SOFTWARE\\ORACLE\\Key_oraclientlog_home2 for Oracle 10 G)

    Instead of hardcoding the Complete folder path(as i mentioned above), is there an universal way to retreive the ORACLE_HOME Location from the Registry editor without mentioning the complete Folder path???

    Please Advise..

    Thanks Aathi
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    That would depend on the Oracle and if you dont have any docs relating to Oracle installation its always not a good method to be finding it because a new version will break your system.
     
  5. Athish

    Athish New Member

    Joined:
    Feb 19, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    thank you for your view....

    how to go about with this issue???

    Better to hard code the location according to the Oracle Version for time being...anyway i agree with you that i need to rewrite again if any other newer version of oracle comes...

    orelse any other better idea u can suggest????


    thanks Aathi
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Have an ini file to have the probable locations and as and when new version comes up you can just add to the ini file so you dont need to be editing the code all the time or at clients place.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice