Results 1 to 10 of 10

Thread: Reading Registry Framwork 1.1/Windows 7

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    177

    Reading Registry Framwork 1.1/Windows 7

    Hey,

    I have a program developed on 1.1 that works perfectly on Windows XP but is having trouble running on Windows 7 simply because of the registry.
    It is to big a program to upgrade to a newer framework so I am just trying to fix the registry reads in Windows 7.

    The one big problem is here

    vb.net Code:
    1. Dim regkey as Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\Elel\View",False)

    But for some reason everytime regkey is always nothing.

    I turned UAC off so it is not that
    And I have Framework 1.1 installed.
    I am not sure what exactly is going wrong unfortunately.

    Any advice?

  2. #2
    Junior Member
    Join Date
    Jul 2013
    Posts
    17

    Re: Reading Registry Framwork 1.1/Windows 7

    could you not change it to currentuser instead of localmachine?

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    17

    Re: Reading Registry Framwork 1.1/Windows 7

    Sorry i rushed that answer out... Do you have more information like for example what the error is?

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Reading Registry Framwork 1.1/Windows 7

    But for some reason everytime regkey is always nothing.
    So have you fired up RegEdit to see whether the key's even there? It's absence would be the most obvious explanation!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  5. #5
    Junior Member
    Join Date
    Jul 2013
    Posts
    17

    Re: Reading Registry Framwork 1.1/Windows 7

    Quote Originally Posted by dunfiddlin View Post
    So have you fired up RegEdit to see whether the key's even there? It's absence would be the most obvious explanation!
    Lol why didn't i think of that,

    Also
    I turned UAC off so it is not that
    I have had weird permission issues with registry and windows 7/8 and i also had UAC off so not sure if UAC makes much difference

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    177

    Re: Reading Registry Framwork 1.1/Windows 7

    Quote Originally Posted by Fma965 View Post
    Sorry i rushed that answer out... Do you have more information like for example what the error is?
    No worries! I tried current user as well but get the same thing. There is no error just the value of Nothing

    Quote Originally Posted by dunfiddlin View Post
    So have you fired up RegEdit to see whether the key's even there? It's absence would be the most obvious explanation!
    Yes xD I have checked if it exists and it does.

    EDIT: You are partially right :P

    http://stackoverflow.com/questions/3...returning-null

    It looks like because I am compiling in 32bit, it is looking into

    Code:
    HKLM\SOFTWARE\Wow6432Node\...
    instead of

    Code:
    HKLM\SOFTWARE\...
    as per the link.

    Now because I am using 2003 and do not think I can compile this in 64bit, does anyone know how to modify the above line of code so it looks in the 32bit directory?
    Last edited by Crzyrio; Jul 9th, 2013 at 03:39 PM.

  7. #7
    Junior Member
    Join Date
    Jul 2013
    Posts
    17

    Re: Reading Registry Framwork 1.1/Windows 7

    Quote Originally Posted by Crzyrio View Post
    No worries! I tried current user as well but get the same thing. There is no error just the value of Nothing



    Yes xD I have checked if it exists and it does.
    Well in .NET 2.0 i just use my.computer.registry.getvalue but i don't think this exists in 1.1 and you don't want to update So i have 2 suggestions

    1. 32-bit and 64-bit applications have different views of the registry. In regedit the key you are getting in code is at HKLM\Wow6432Node\Software\Elel\View not HKLM\Software\Elel\View
    2. Run as admin

    Also are you trying to get a Key or Value?

  8. #8
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Reading Registry Framwork 1.1/Windows 7

    So, to be clear, you're compiling for Framework 1.1 (2003, all support ended 2008) using VS 2003 (now in its 5th revision since then) on a 64 bit machine (first supported by MS c. 2005) for Windows 7 (2009) which has a minimum framework of 3.5? What could possibly go wrong?

    Presumably with 2003 there's not even an AnyCPU option so I really don't know how to get you out of the hole.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  9. #9
    Junior Member
    Join Date
    Jul 2013
    Posts
    17

    Re: Reading Registry Framwork 1.1/Windows 7

    Quote Originally Posted by dunfiddlin View Post
    So, to be clear, you're compiling for Framework 1.1 (2003, all support ended 2008) using VS 2003 (now in its 5th revision since then) on a 64 bit machine (first supported by MS c. 2005) for Windows 7 (2009) which has a minimum framework of 3.5? What could possibly go wrong?

    Presumably with 2003 there's not even an AnyCPU option so I really don't know how to get you out of the hole.
    LOL, Epic summary

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    177

    Re: Reading Registry Framwork 1.1/Windows 7

    Quote Originally Posted by dunfiddlin View Post
    So, to be clear, you're compiling for Framework 1.1 (2003, all support ended 2008) using VS 2003 (now in its 5th revision since then) on a 64 bit machine (first supported by MS c. 2005) for Windows 7 (2009) which has a minimum framework of 3.5? What could possibly go wrong?

    Presumably with 2003 there's not even an AnyCPU option so I really don't know how to get you out of the hole.
    Thanks....

    There is always a way, just a matter of finding it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width