Can you show any codes at all? It doesn't help anyone here narrow down your problem.
If I would take a guess though, there's something wrong with the way you have specified LPCTSTR lpSubKey in either RegOpenKeyEx or RegDeleteKey.
If you created a key:
In order to delete it, you would need something like this:
RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software", 0, KEY_ALL_ACCESS, &RegHandle) RegDeleteKey(RegHandle, test)
RegOpenKeyEx(HKEY_LOCAL_MACHINE, someNullValue, 0, KEY_ALL_ACCESS, &RegHandle) RegDeleteKey(RegHandle, L"Software\test")
Make sure you check out the functions again at MSDN.