I was unable to cause my C# DLL to be a ActiveX control, instead I
made it work as a COM server. The trick is registering it on the fly.
1) Make your C# DLL a regular COM server
2) Run regasm /codebase /regfile:somefile.txt
3) During your gadget's initialization
a) check if dot net is installed to the version you need
if
(wshShell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET
Framework Setup\\NDP\\v2.0.50727\\Install") != 1) // .Net 2.0 is not
installe
return false;
b) extract the DLL gadget.storage.extract() and using WScript.Shell
write all those keys in somefile.txt the the registry.
like so:
wshShell.RegWrite
("HKCR\\CLSID\\{3CC59E75-7B59-434b-A2F3-
C14D0596EA7C}\\", "gDesktopShortcuts_ax.gDesktopShortcuts", "REG_SZ");
...
It's important to note that .Net is not as prevalent as it seems, so
might make sense to have a fallback native server that can do the same
job. My server is not visual, so it made sense and wasn't too crazy
to support.
- 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
-~----------~----~----~----~------~----~------~--~---