Last active
October 16, 2015 06:48
-
-
Save sandersaares/f085be7be16a02716662 to your computer and use it in GitHub Desktop.
Registering 32-bit COM objects for access from a 64-bit process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void RegisterComObjectsFor64BitProcesses() | |
{ | |
var comObjectsToRegister = new List<string> | |
{ | |
Constants.WmrmKeysComObjectKeyName, | |
Constants.WmrmHeaderComObjectKeyName, | |
Constants.WmrmProtectComObjectKeyName | |
}; | |
foreach (var comObject in comObjectsToRegister) | |
{ | |
Registry.LocalMachine.CreateSubKey("Software\\Classes\\AppID\\" + comObject); | |
var hkcrClsid = Registry.ClassesRoot.CreateSubKey("Wow6432Node\\CLSID\\" + comObject); | |
hkcrClsid.SetValue("AppID", comObject); | |
hkcrClsid.Close(); | |
var hkcrAppId = Registry.ClassesRoot.CreateSubKey("Wow6432Node\\AppID\\" + comObject); | |
hkcrAppId.SetValue("DllSurrogate", string.Empty); | |
hkcrAppId.Close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment