6
Answers

How to convert VC++ code to C# code?

gongdehui

gongdehui

20y
2.2k
1
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; } }
Answers (6)