I have have done this with my gadget. The trick is registering
your .Net assembly on the fly.
steps:
1) Make a C# COM server
2) run regasm /regfile:somefile.reg against your assembly
3) on gadget startup, if .Net is installed extract your gadget add
those registry entries:
var wshShell = new ActiveXObject("WScript.Shell");
if (wshShell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET
Framework Setup\\NDP\\v2.0.50727\\Install") != 1) // .Net 2.0 is not
installed
return
var path = gadget.storage.extract("gDesktopShortcuts_ax_net.dll");
//debug.trace("path= "+path);
//--------------------------------------------------------------------------------
//[HKEY_CLASSES_ROOT\gDesktopShortcuts_ax.gDesktopShortcuts]
//@="gDesktopShortcuts_ax.gDesktopShortcuts"
wshShell.RegWrite ("HKCR\\gDesktopShortcuts_ax.gDesktopShortcuts\\",
"gDesktopShortcuts_ax.gDesktopShortcuts");
5) access your C# code
new ActiveXObject("gDesktopShortcuts_ax.gDesktopShortcuts");
- mattb
On Dec 3, 8:54 am, Michael <[EMAIL PROTECTED]> wrote:
> Has anyone successfully built a C# DLL using MS Visual Studio (2005 or
> 2008) that can be invoked within a gadget's Javascript?
>
> I' searched the web but no clear answers are out there. I've tried
> several different options to build and include the DLL but whenever
> the javascript tries to load the DLL, it throws an exception.
>
> Any help would be appreciated. I have a lot of C# code that I don't
> want to have to port to C++ to get this working.
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---