I have a program written in C++ using Visual Studio 2005.
At some point in my code I would like to call the function RegDeleteKey to delete a specific registry key.
My code is as simple as this:
LONG MyClass::deleteAKey(CString path)
// open the key
if ( ERROR_SUCCESS != RegOpenKeyEx ( HKEY_LOCAL_MACHINE, path, 0, _sam, &_hKey))
//Could not open the registry key
lRet = RegDeleteKeyEx(_hKey, path, KEY_WOW64_64KEY, 0);
All compiles and links fine. But when I try to run my program, I immediately get the error message, "The procedure entry point RegDeleteKeyExW could not be located in the dynamic link library ADVAPI32.dll". Now I wonder what could be wrong.
At the top of my .cpp file, I have also added the line:
#pragma comment(lib, "Advapi32.lib")
but nothing helps.
I'm guessing it has to do with name mangling but I'm not sure how to go about fixing this. I'm not sure...just a guess.
Can anyone help?
Thanks so much