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. Problem in RegQueryValue.

Problem in RegQueryValue.

Scheduled Pinned Locked Moved C / C++ / MFC
javahelpquestion
3 Posts 3 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.
  • G Offline
    G Offline
    GauranG Shah
    wrote on last edited by
    #1

    I am using the RegQueryValueEx() Function to fethch the value from the reggistry I set previously. But getting porblem. It fetches only first charcter only.It Show the Corrent size of the Value but Fail to Fetch the Whole String.Previously I was using the RegQueryValue() and It is working Fine :). But I need to use RegQueryValueEx() as I have to fetch Other valued in addition with default.:( The Code I am using is as follow. RegOpenKey(HKEY_CURRENT_USER,L"Software\\PersonalMenu",&hKey); Code= RegQueryValueEx(hKey,L"JAVA",0,&Type,NULL,&size); BYTE *Data = new BYTE[size]; Code= RegQueryValueEx(hKey,L"JAVA",0,&Type,(BYTE *)Data,&size); I dont know what is the problem with it. If it is showing the Correct size of the Value don't it also show the Value.

    C M 2 Replies Last reply
    0
    • G GauranG Shah

      I am using the RegQueryValueEx() Function to fethch the value from the reggistry I set previously. But getting porblem. It fetches only first charcter only.It Show the Corrent size of the Value but Fail to Fetch the Whole String.Previously I was using the RegQueryValue() and It is working Fine :). But I need to use RegQueryValueEx() as I have to fetch Other valued in addition with default.:( The Code I am using is as follow. RegOpenKey(HKEY_CURRENT_USER,L"Software\\PersonalMenu",&hKey); Code= RegQueryValueEx(hKey,L"JAVA",0,&Type,NULL,&size); BYTE *Data = new BYTE[size]; Code= RegQueryValueEx(hKey,L"JAVA",0,&Type,(BYTE *)Data,&size); I dont know what is the problem with it. If it is showing the Correct size of the Value don't it also show the Value.

      C Offline
      C Offline
      carrivick
      wrote on last edited by
      #2

      Do you have a unicode project setting but not viewing the string as unicode ? This would explain that you would see the first character.

      1 Reply Last reply
      0
      • G GauranG Shah

        I am using the RegQueryValueEx() Function to fethch the value from the reggistry I set previously. But getting porblem. It fetches only first charcter only.It Show the Corrent size of the Value but Fail to Fetch the Whole String.Previously I was using the RegQueryValue() and It is working Fine :). But I need to use RegQueryValueEx() as I have to fetch Other valued in addition with default.:( The Code I am using is as follow. RegOpenKey(HKEY_CURRENT_USER,L"Software\\PersonalMenu",&hKey); Code= RegQueryValueEx(hKey,L"JAVA",0,&Type,NULL,&size); BYTE *Data = new BYTE[size]; Code= RegQueryValueEx(hKey,L"JAVA",0,&Type,(BYTE *)Data,&size); I dont know what is the problem with it. If it is showing the Correct size of the Value don't it also show the Value.

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Are you getting a string value into a BYTE array? If so, how are you examining the string?  Intellisense may only show you the first byte. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        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