As part of my investigation of smart clients and security, I got a little side-tracked, not much really, into wondering about hosting winform usercontrols in IE.
The first thing that I learned was that this only works with IE. I don't know if this is a big deal or not - depends on the application I suppose. For my learning experiments and how I am applying this stuff to my work applications it doesn't matter.
A friend asked my about embedding .net into web applications similar to the way active-x is done. I thought that it was possible - I had read that it was, but as usual until I try something it is really a black hole - doable, sure, but ...
I had a Chart recorder winform that I downloaded from somewhere. I kinda wish the person that wrote it had put their name in the code - I would like to attirbute code that I've stolen.
I converted the winform to a UserControl - stripping out some extra ui stuff to just get the chart recorder. For testing I embedded it in a winform and all worked fine.
Then I created an html page and embedded it. I created a vdir for this project and ran the user control with IE and my html page as the debugger. Didn't run! There is a timer that is normally started that runs the chart paper. What is going on? My first thought was some kind of permissions thing. I soon sent off an email to my favorite mail list "wintech off topic" and was asked about which timer I was using to cause the chart recorder to move. I was using System.Timers.Timer. I switched to System.Winforms.Forms.Timer and it still didn't work - except when IE is hidden under another window. Interesting.
Debugging using IE is interesting. I received a link to this http://urbanasylum.dynu.com/JustTheFacts/archives/000092.html which has helped.
I uploaded my project to my web hosting site (brinkster) and tried it. Nothing works even hiding ie.
Anyway, that's where I am today. This is fun.