Hi, I'm trying to run the first code snippet above, I changed it to an actual registry key instead of "mykey"
HKEY key;
if (RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion"), &key) != ERROR_SUCCESS)
{
cout << "Unable to open registry key”;
}
I'd love to use these examples to write some code for reading and editing the registry, but I can't seem to get them working under visual studio 2010. This is the output I'm getting when I try to build:
1>------ Build started: Project: regops, Configuration: Debug Win32 ------
1>Build started 7/1/2012 10:06:16 PM.
1>InitializeBuildStatus:
1> Touching "Debug\regops.unsuccessfulbuild".
1>ClCompile:
1> regops.cpp
1>c:\users\marcus\documents\visual studio 2010\projects\regops\regops\regops.cpp(1): error C2146: syntax error : missing ';' before identifier 'key'
1>c:\users\marcus\documents\visual studio 2010\projects\regops\regops\regops.cpp(1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\marcus\documents\visual studio 2010\projects\regops\regops\regops.cpp(1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\marcus\documents\visual studio 2010\projects\regops\regops\regops.cpp(2): error C2059: syntax error : 'if'
1>c:\users\marcus\documents\visual studio 2010\projects\regops\regops\regops.cpp(3): error C2143: syntax error : missing ';' before '{'
1>c:\users\marcus\documents\visual studio 2010\projects\regops\regops\regops.cpp(3): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\marcus\documents\visual studio 2010\projects\regops\regops\regops.cpp(4): error C2001: newline in constant
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.57
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This post has been edited by JackOfAllTrades: 02 July 2012 - 07:20 AM

New Topic/Question
Reply



MultiQuote





|