How to convert VC++ code to C# code?
Hi!
How to convert the following VC++ code to C# code,what does the corresponding C# code look like?
HKEY CreateRegistryKey(DWORD *pdwStatus)
{
LONG lResult;
DWORD dwDisposition;
HKEY hKey = NULL;
lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
subkey,
0,
NULL,
REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE,
NULL,
&hKey,
&dwDisposition
);
if(lResult == ERROR_SUCCESS)
{
if(dwDisposition == REG_CREATED_NEW_KEY)
{
*pdwStatus = REG_KEY_CREATED;
}
else if(dwDisposition == REG_OPENED_EXISTING_KEY)
{
*pdwStatus = REG_KEY_OPENED;
}
return hKey;
}
}