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 problem

Registry problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestioncssdatabasewindows-admin
2 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.
  • Y Offline
    Y Offline
    yamini
    wrote on last edited by
    #1

    Hi All, I have a query regarding REGEDT32.EXE .I try to programmatically set value for a field in the Registry.This value is a string value.I am using RegSetValueEx() for this and the the maximum length of this string I am specifying as 256.Now, the problem is when the string length is less than this maximum value after the required string some junk values are put in the REGEDT32.EXE .These junk values should not be there in the value for a field.How can I do this? When I tried the same in Regedit.exe there is no such problem.Whatever may be the string length there are no junk values in the Regedit.exe. How has to be done to rectify the problem.I also tried NULL terminating the String.Still the problem persists. Thanx in advance for the help. Regards, yamini.

    M 1 Reply Last reply
    0
    • Y yamini

      Hi All, I have a query regarding REGEDT32.EXE .I try to programmatically set value for a field in the Registry.This value is a string value.I am using RegSetValueEx() for this and the the maximum length of this string I am specifying as 256.Now, the problem is when the string length is less than this maximum value after the required string some junk values are put in the REGEDT32.EXE .These junk values should not be there in the value for a field.How can I do this? When I tried the same in Regedit.exe there is no such problem.Whatever may be the string length there are no junk values in the Regedit.exe. How has to be done to rectify the problem.I also tried NULL terminating the String.Still the problem persists. Thanx in advance for the help. Regards, yamini.

      M Offline
      M Offline
      markkuk
      wrote on last edited by
      #2

      The last parameter of RegSetValueEx() isn't a "maximum" length, but the actual length of the string, including the terminating zero.

      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