Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.NET applet in MCE

13 views
Skip to first unread message

wolfman

unread,
Jan 24, 2006, 7:19:06 PM1/24/06
to
I see one paragraph in the SDK about hosting a .NET applet in a HTML page for
MCE. I'm very familiar with .NET application programming, but not
programming for the web. It's been about 8 years since I've written any
HTML, and obviously things have changed. Thus the hosted HTML model is
pretty foreign to me.

I want to write a "visual experience" in .NET and expose it as an HTML
hosted .NET applet. How is this done? An MSDN search for ".NET applet" only
returns one result - the page from the MCE SDK :-)

So, what the heak is a .NET applet, and how do I use it in Media Center.

This page: http://www.codeproject.com/dotnet/CSharpApplet.asp provides a
clue to .NET applets, but I still don't understand how to host them in MCE.

I've read that in Vista, MCE add-ins will be able to provide UI elements.
But for now it looks like I'll have to host it in HTML.

Thanks in advance!

wolfman

unread,
Jan 26, 2006, 9:17:06 AM1/26/06
to
OK, I'm a bit less ignorant than two days ago (but still quite ignorant). I
learned that a .NET applet was more properly termed a HTML hosted windows
forms control.

Once I figured that out there was a ton of info on using hosted .NET windows
forms controls in web pages. Pretty straightforward.

However, I didn't see anything which indicated how to use these without a
web server. All the doucmentation said that the html page containing the
control as well as the control assembly (i.e. the .dll) should reside in a
virtual directory on the web server.

If I want to install the assembly and html page local in a file for MCE how
to I refer to it? I tried adding it to the global assembly cache but that
didn't work. The html syntax for including a .NET windows forms control is:

<OBJECT id="MyControl" classid="myassembly.dll#MyAppletControl.MyApplet>
</OBJECT>

Where do I put the html, the .dll, and how do I modify the above syntax to
point to it?

Thanks!

Sean McLeod

unread,
Jan 26, 2006, 10:35:53 AM1/26/06
to
If you use the following style:

classid="myassembly.dll#MyAppletControl.MyApplet"

to specify your .Net control then the assembly has to be hosted by a web
server. If you want your code to live in the local file system then you need
a couple of changes.

Have a look at the following knowledge base article for details.

http://support.microsoft.com/default.aspx/kb/317346/EN-US/

Cheers

"wolfman" <wol...@discussions.microsoft.com> wrote in message
news:3D6FDF9C-600C-4115...@microsoft.com...

wolfman

unread,
Jan 26, 2006, 12:59:05 PM1/26/06
to
Thanks, I think I can figure this out.

In this case do I have the flexibility to write my windows form control in
.NET 2.0? I'm starting a clean project and would like to use the most
current methods available.

h_arted

unread,
Jan 28, 2006, 6:18:54 PM1/28/06
to
Wolfman,

Do a search for activex on www.thegreenbutton.com. Or do a search for my
posts as h_arted. I have uploaded an activex template that will show you how
to com register a winform .net assembly and use it in an html page. If you
look at my mce game mcepeaks at www.10footgames.net you will see that this
is what you are trying to do.

Dean


"wolfman" <wol...@discussions.microsoft.com> wrote in message

news:1DC0681A-0D45-483B...@microsoft.com...

wolfman

unread,
Jan 28, 2006, 8:14:27 PM1/28/06
to
Thanks h_arted,

I couldn't find your template - you've got quite a few posts on
thegreenbutton.com. If you can point me to it that would be great.

Did you develop mcepeaks as an ActiveX application, or as a .NET application
exposed as activex using com interop? I successfully implemented a .NET 1.1
framework "hello world" application and exposed it using comm interop. My
current problem is that I was intending to use a 3rd party purchased .NET
control as a component of my applet which I write for MCE. That didn't work.
I gotta keep banging my head on the desk until it works - hopefully soon!
At least I'm learning a lot.

-JSS

sup...@10footgames.net

unread,
Jan 30, 2006, 9:38:55 AM1/30/06
to
Hi,

Have a look here
http://www.thegreenbutton.com/community/shwmessage.aspx?ForumID=30&MessageID=137195

Go to the third post and download the template.

mcepeaks was created as a .Net control that is COM enabled. It is then
loaded into the HTML document.

h_arted

"wolfman" <wol...@discussions.microsoft.com> wrote in message

news:4BCC5F0C-E223-44D6...@microsoft.com...

casey chesnut

unread,
Jan 30, 2006, 11:16:47 AM1/30/06
to
cool ... will the .NET controls render in Extender sessions?

Thanks,
casey

<sup...@10footgames.net> wrote in message
news:edD8qraJ...@TK2MSFTNGP09.phx.gbl...

casey chesnut

unread,
Jan 30, 2006, 2:13:20 PM1/30/06
to
checked at lunch and they do remote to Extenders!

now i'm wondering if you can host a .NET 2.0 WinForm control in MCE 2005, or
if its also limited to .NET 1.1?

"casey chesnut" <casey@MORE_SPAMbrains-N-brawn.com> wrote in message
news:%239wqJib...@tk2msftngp13.phx.gbl...

sup...@10footgames.net

unread,
Jan 31, 2006, 10:00:42 AM1/31/06
to
Casey,

You have tested the .NET control and they work with extenders? Cool! Not
having access to one, they cost about the same amount as a full blown mce in
the UK, I have not been able to test my game.

The .NET control, stretched to the full screen, works a charm. After years,
yes, years or trial and error, this is the absolute BEST way to develop .NET
application for the media center. No more crappy HTML to work with, graphics
on the fly, animation the way you want it, thread and process control... All
good. There are a few things that need to be dealt with, scaling of
graphics, controls on the main control snatch the focus from the main
control and makes navigation a problem but when you understand the issues,
it is easy as pie.

When you develop something new, you create it as a normal .NET application
and you can cut and paste it into a new AXtemplate, change the GUIDs and
things and off you go. Working mce app with the full power of the .NET
framework.

I see no reason why framework 2.0 will not work. After all, by developing
this way, we remove the MCE add-ins interface all together. You can pass the
MCE object from the HTML to the ActiveX object which can then use it to do
various things like create MCE dialogs etc.

If you have not done so already, check out what I have done with mcepeaks
V2.0, www.10footgames.net, and if possible, test it on the extender for me
please.

Thanks

Dean

"casey chesnut" <casey@MORE_SPAMbrains-N-brawn.com> wrote in message

news:umnB1EdJ...@TK2MSFTNGP10.phx.gbl...

casey chesnut

unread,
Jan 31, 2006, 11:18:24 AM1/31/06
to
Yes, i tested mcepeaks v2 and it seems to work fine on an x360.
(honestly, i haven't taken the time to understand how to actually play yet)
and it definitely looks better than Hosted HTML.
even works with the wireless game controller.

really wish i would have known about this technique earlier,
for some reason i thought it was ActiveX controls only.

Thanks,
casey

<sup...@10footgames.net> wrote in message
news:u1EPfcnJ...@TK2MSFTNGP10.phx.gbl...

Michael Creasy - [MS]

unread,
Jan 31, 2006, 12:27:23 PM1/31/06
to
It's pretty unlikely that you'll be able to use 2.0. The host process
(ehExtHost.exe) uses the 1.1 version of the framework and will not be able
to load 2.0 assemblies.

--
Michael Creasy [MS]
http://www.michaelcreasy.com/blog

"casey chesnut" <casey@MORE_SPAMbrains-N-brawn.com> wrote in message

news:umnB1EdJ...@TK2MSFTNGP10.phx.gbl...

casey chesnut

unread,
Jan 31, 2006, 1:03:50 PM1/31/06
to
Thanks Michael, i was hoping that Hosted HTML might work differently :(

"Michael Creasy - [MS]" <mcr...@online.microsoft.com> wrote in message
news:ulv9Zuo...@TK2MSFTNGP09.phx.gbl...

sup...@10footgames.net

unread,
Jan 31, 2006, 1:19:59 PM1/31/06
to
I guess we just have to try. I think that the page is loaded just as it
would be in Internet Explorer so I cannot see any reason for it not to work.

I am not ready to move to 2.0 yet so it won't be me. Thanks for testing
mcepeaks for me. Great to know that it does work.

Casey, If you need to know more about this and the potential problems, let
me know.

Dean


"casey chesnut" <casey@MORE_SPAMbrains-N-brawn.com> wrote in message

news:OUU5mCpJ...@TK2MSFTNGP12.phx.gbl...

Sean McLeod

unread,
Jan 31, 2006, 1:36:38 PM1/31/06
to
The issue is that it isn't the case that a standalone version of IE is
launched to host your MCE html add-in when the user runs your add-in. In
that case there wouldn't generally be a problem hosting .net 2.0 controls in
the IE browser.

Instead ehExtHost.exe is launched which itself contains .net 1.1 code, so
the .net 1.1 virtual machine is loaded. The ehExtHost.exe then hosts the IE
browser control which loads your HTML add-in and ehExtHost.exe also provides
the MCE object model to the browser control.

Since the .net 1.1 virtual machine would've been loaded already into the
ehExtHost process before the browser control tries to load your .net 2.0
controls you're snookered.

Cheers

<sup...@10footgames.net> wrote in message
news:Oa2p1LpJ...@TK2MSFTNGP09.phx.gbl...

wolfman

unread,
Feb 2, 2006, 4:47:27 PM2/2/06
to
h_arted,

Thanks for the link to the template for the .NET control. I only wish I had
seen it earlier, would have saved me a ton of time. I figured out most of
this eventually, but your shell cleared up a few more things for me.

I agree strongly that a .NET control which is COM enabled is definatly the
way to go. You're example should be added to the MCE SDK!

casey chesnut

unread,
Feb 11, 2006, 9:23:23 AM2/11/06
to
in case you're interested, i ended up writing a dev article about this
technique
http://www.brains-N-brawn.com/mceVideoSearch/

Thanks,
casey

"wolfman" <wol...@discussions.microsoft.com> wrote in message

news:3C5BBBD1-AD4A-4BA6...@microsoft.com...

0 new messages