CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Hosting .net winforms in IE (the tabletinspector goes online)

Thanks to Julia Lerman's talk at Windows Anywhere I've got my tabletinspector online.

The original application was a .net winforms thing. It's a form containing one big windows-usercontrol. The user control itself is in a dll. Internet Explorer can host .net usercontrols provided the .net framework is installed on the client machine. The containing page does not have to be an ASP.NET page, any html page will do. In fact this inspector is served by my providers's Unix box.

The usercontrol is specified in a pair of <Object> tags.

<OBJECT id=Watcher
title="You need a (PC with the) tablet PC (API installed) to view this page."
height=
"90%" width="100%"
classid=
TabletLib.dll#TabletLib.TabletWatcher VIEWASTEXT
</OBJECT>

The classId of the object points to the TabletLib.dll, which houses the usercontrol. The name of the dll is followed by a # and the qualified name of the usercontrol class: TabletLib.TabletWatcher. The browser expects the dll in the same directory as the webpage on the server. It does not have to be there, this makes up a valid object as well:

classid=http://MyAppSerever/TabletStuff/TabletLib.dll#TabletLib.TabletWatcher

Now the browser will look for the dll on quite a different server. For this to work right you will hit some security issues. The trust level of the other server will be different than that of the site you're visiting and as a result the runtime might refuse to load the dll.

Note the height and width properties of the object. These are relative. As the controls in the usercontrol have their anchors set to multiple borders they do size with the browser.

The result can be found here. If you have a tablet go there and check out the capabilities of its digitizers.


Published Feb 16 2005, 02:46 PM by pvanooijen
Filed under: ,

Comments

TrackBack said:

# February 28, 2005 7:41 AM

TrackBack said:

# March 8, 2005 6:09 AM

Peter's Gekko said:

Having spent 3 solid days on doing a crash-course VS 2005 training it's time for a little diversion....
# June 16, 2005 5:09 AM

Community Blogs said:

Despite all the nice UI and usability offerings of AJAX nothing beats a real windows control. These days

# June 20, 2007 11:50 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!