Char *到注册表,然后检索它? [英] Char* to registry, then retrieve it?

查看:85
本文介绍了Char *到注册表,然后检索它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做一些涉及注册表的工作。

我可以写和读数字很好,但是我坚持写作和阅读字符串。


我已经谷歌搜索了一段时间,发现大部分是对vc的引用。


所以基本上,有人可以向我解释如何将char *写入注册表项,并且然后再次检索它,进入char *形式。

Hi, I have been doing some work involving the registry.
I can write and read numbers fine, but im stuck writing and reading strings.

I''ve been googling for a while, and found mostly references to vc.

So basicly, can someone explain to me how to write a char* to a registry key, and then retrieve it again, into char* form.

推荐答案

也许这个链接有帮助吗?


亲切的问候,


Jos
Maybe this link helps?

kind regards,

Jos


啊,我正在使用regQueryValueEx,感谢链接,我环顾四周,发现:

"确保任何字符串值返回的(REG_SZ,REG_MULTI_SZ和REG_EXPAND_SZ)是空终止的,使用RegGetValue函数。


我使用了RegGetValue,但包括windows.h和winreg。 h,编译器说它没有b定义了。有什么想法吗?
Ah, I was using regQueryValueEx, thanks for the link, I looked around and found:
"To ensure that any string values (REG_SZ, REG_MULTI_SZ, and REG_EXPAND_SZ) returned are null-terminated, use the RegGetValue function."

I had a go at using RegGetValue, but including windows.h, and winreg.h, the compiler says it has not been defined. Any ideas?


@ Adam01
RegGetValue 是一个相对较新的功能。您需要将 _WIN32_WINNT 设置为> = 0x600 才能使用它。
@Adam01
RegGetValue is a relatively new function. You''ll need to set _WIN32_WINNT to >= 0x600 in order to use it.


这篇关于Char *到注册表,然后检索它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆