1
我在我的应用程序中使用“RegSetKeyValue”API。我指的是http://msdn.microsoft.com/en-us/library/ms724921(VS.85).aspx。与RegSetKeyValue的链接器错误
正如文章中所述,我将_WIN32_WINNT_定义为0x0600,并且在我的链接器选项中包含了Advapi32.lib。
但仍然收到链接器错误,“无法解析的外部符号_RegSetKeyValue”。请告诉我我在这里错过了什么。
这是我的代码片段。
#define _WIN32_WINNT (0x0600)
#include <windows.h>
int main()
{
LONG status;
status = RegSetKeyValue(HKEY_LOCAL_MACHINE,
"SOFTWARE\\7-Zip",
"path",
REG_SZ,
"C:\\newfolder\\path",
strlen("C:\\chethan\\path")+1);
return 0;
}
PS:我用VC此++ 6.0(甚至试图在Visual Studio 2005中,同样的错误呢!)。
噢好吧......我在Windows-XP上使用它。 非常感谢:) – Microkernel 2010-04-22 11:00:12