fattumsdad
asked on
Can't figure out error....
In the following code:
private: System::Void cmdUnlock_Click(System::Ob ject * sender, System::EventArgs * e)
{
if ( txtUnlock->Text == "unlockme" )
{
RegistryKey* kUnlock = Registry::CurrentUser->Del eteSubKey( S"Player\0 ");
MessageBox::Show(S"Unlocke d!\nPlease exit and restart application!","Unlocked",
MessageBoxButtons::OK,Mess ageBoxIcon ::Informat ion);
}else
{
MessageBox::Show(S"Incorre ct Code","Error",
MessageBoxButtons::OK, MessageBoxIcon::Error);
txtUnlock->Clear();
txtUnlock->Focus();
}
}
I get the following error:
error C2440: 'initializing' : cannot convert from 'void' to 'Microsoft::Win32::Registr yKey __gc *'
Any ideas how I can fix this?
private: System::Void cmdUnlock_Click(System::Ob
{
if ( txtUnlock->Text == "unlockme" )
{
RegistryKey* kUnlock = Registry::CurrentUser->Del
MessageBox::Show(S"Unlocke
MessageBoxButtons::OK,Mess
}else
{
MessageBox::Show(S"Incorre
MessageBoxButtons::OK, MessageBoxIcon::Error);
txtUnlock->Clear();
txtUnlock->Focus();
}
}
I get the following error:
error C2440: 'initializing' : cannot convert from 'void' to 'Microsoft::Win32::Registr
Any ideas how I can fix this?
ASKER
But why would it return void, when the subkey has already been verified as existing?
I didn't design the API. See for yourself:
http://tinyurl.com/58gdp
It seems appropriate to me, since you're deleting the specified subkey.
http://tinyurl.com/58gdp
It seems appropriate to me, since you're deleting the specified subkey.
ASKER
Any idea how to make it work?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
RegistryKey* kUnlock = Registry::CurrentUser->Del
the DeleteSubKey() method returns void.