Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created December 24, 2010 13:56
Show Gist options
  • Select an option

  • Save follesoe/754251 to your computer and use it in GitHub Desktop.

Select an option

Save follesoe/754251 to your computer and use it in GitHub Desktop.
Snippet for the blog post "Free SMS Gadget for Vista using .NET Interop"
////////////////////////////////////////////////////////////////////////////////
//
// Add the Gadget.Interop dll to the registry so it can be used by COM and
// created in javascript as an ActiveX object
//
////////////////////////////////////////////////////////////////////////////////
function RegisterGadgetInterop()
{
try
{
// Full path to the Gadget.Interop.dll assembly
var fullPath = System.Gadget.path + assemblyStore;
var asmPath = fullPath + assemblyName;
// Register the interop assembly under the Current User registry key
RegAsmInstall("HKCU", progID, "Gadget.Interop.GadgetAdapter", guid,
"Gadget.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9389e9f4d8844504",
"1.0.0.0", asmPath);
if(InteropRegistered() == false)
{
// Try Register the interop assembly under the Local Machine registry key
RegAsmInstall("HKLM", progID, "Gadget.Interop.GadgetAdapter", guid,
"Gadget.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9389e9f4d8844504",
"1.0.0.0", asmPath);
}
}
catch(e)
{
System.Debug.outputString("RegisterGadgetInterop fails: " + e.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment