Writing string (REG_SZ) values to the registry in C++

后端 未结 3 651
天涯浪人
天涯浪人 2021-02-01 18:57

I\'ve got most of the code for writing a value to the windows registry, however when I change the path to a dummy key and value that I\'ve set up for testing it fails. My code

3条回答
  •  猫巷女王i
    2021-02-01 19:43

    I feel silly. The solution is that need to properly escape the slash in the string as follows:

    LPCTSTR sk = TEXT("SOFTWARE\\TestSoftware");
    

    Hopefully someone finds this useful...

提交回复
热议问题