.NET CF, AxHost, and PDC
Saw the keynote this morning? I did! Like the demo that included hosting the Windows Media Player ActiveX control inside of a .NET Compact Framework app? I did! Wonder how they did that considering that CFv2 doesn't include some of the classes you'd use to that on the desktop (such as AxHost)? I did! Think they were faking it? I asked around...
Here's the secret: the demo leveraged the implementation of those classes that Alex Fienman built for OpenNETCF. Alex's webcast on this topic can be seen here and the associated code can be downloaded here.
Our developer community rocks! What I love most about my job is getting to interact with cool folks like Alex who really make the Windows Mobile platform shine.
-Robert
ps: it turns out that contrary to what I told everyoe who asked over the past few weeks, I'm not at PDC. was going to do a demo in the wednesday keynote but decided to give that spot back to mike hall and stay in redmond with my dev/test teams who are hitting some critical deadlines this month on a brand new app & API set for windows mobile. can't say what it is yet (we aren't even talking about it at pdc) but you can definitely count on it making a huge splash in the mobile software industry next year.
Comments
Anonymous
September 13, 2005
.NET CF, AxHost, and PDC [Via:
windowsmobile ]
ASP.NET 2.0 Beta2 to RTM changes
[Via: Jackie Goldstein...Anonymous
September 14, 2005
Hi Robert,
We are trying to migrate our CF1.0 project to Visual Studio 2005 Beta2, it is causing a lot of problems with UI - all screens have to be re-drawn with the new controls (the code seems to still work). Please let us know is there any upgrade or converion tools available.
Kinldy also provide us some information about smooth migrating techniques from older .Net CF applicaitons to .Net 2.0 CF
Thanks
MDeeviAnonymous
November 03, 2005
The comment has been removedAnonymous
November 13, 2005
I run demo application and get error message on my device:
"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in OpenNETCF.Windows.Forms.AxHost.dll
Additional information: Class not registered."
I have installed Microsoft Windows Media Player 8.x for Pocket PC SDK.
What is problem?Anonymous
January 15, 2006
<No video when trying to host WMPCEOXC (MP8)>
Hi,
Mr. Feinman has done an excellent job and the code runs fine with MP10. However, I am trying to make it work for PocketPCs that don't have media Player 10. I know that MP9 does not have an OCX interface. I am trying with Media Player 8 (the WMPCEOCX.dll distributed through the Media Plaeyr for CE SDK by Microsoft). This is a proper ActiveX control that I can successfuly host on Pocket Internet Explorer and through Odyssey's CFCOM in .NET CF. I can get the control to show on a form (VB) but when I open a file I get the audio playing fine but it displays no video.
Do you have any hints on what I should do?
Have you tried this solution with this previous version of Media Player? I think it would be very useful for many, since Microsoft does not distribute MP10 and many vendors (e.g. HP) do not offer upgrades for most of their devices to Windows Mobile 2003 SE (incl WMP10).
... a few details:
From the WMPPktPC SDK I get the PlayerOCX.idl. I run MIDL to create the .tlb file, which I reference in my project. I create a class (AxWMP8) that inherits from AxHost (as shown in the webcast) and I write the simple code for properties FileName, AutoStart and Play. Everything BUT the video display works.
I noticed in the CFCOM implementation that on their WMPCE library they have .recompose method that is not part of the Media Player OCX - do you think this is important?
Anyway, sorry for being so long, If you can offer any help it will be highly appreciated.
ChristosAnonymous
February 06, 2006
Great code just what I was looking for.
But oh yes there is always a but. My activeX dll does not support onClick, but I sure what it, does anyone know how to add onClick to an application? I have tried to add a control above and making it invisible, but in windows mobile 5 this is not possible.Anonymous
September 13, 2006
The comment has been removedAnonymous
November 13, 2006
When using the media player control 10 on a smart phone, the play controls - volume, play/pause and next/Previous track are missing. Is there any way to make them appear once again?Anonymous
April 10, 2007
yes, Addd this interface in your code. [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] [Guid("74C09E02-F828-11D2-A74B-00A0C905F36E")] public interface IWMPControls { [DispId(60)] IWMPMedia currentItem { get; set; } [DispId(61)] int currentMarker { get; set; } [DispId(56)] double currentPosition { get; set; } [DispId(57)] string currentPositionString { get; } [DispId(54)] void fastForward(); [DispId(55)] void fastReverse(); [DispId(62)] bool get_isAvailable(string bstrItem); [DispId(58)] void next(); [DispId(53)] void pause(); [DispId(51)] void play(); [DispId(63)] void playItem(IWMPMedia pIWMPMedia); [DispId(59)] void previous(); [DispId(52)] void stop(); } After this, you can use play/pause and next/Previous track.Anonymous
October 08, 2007
The comment has been removedAnonymous
October 16, 2007
The comment has been removedAnonymous
October 18, 2007
I have integrated Mr. A. Fienman code in my application and Media Player works fine when the PDA screen orientation is set in portrait mode. As soon as I switch orientation to Landscape the PDA hangs and it isn't possible to stop the application from debug mode and the only way to reset the PDA is turning it off. I am using as test bed PDA an HTC P3300. Thinking the problem was the obsolete version of WMPLIB.DLL I have substituted it with WMPOCX.Dll, creating all the event methods as required by the new OCX signatures. In this case I haven't changed the AX Hosting library and nothing has changed. So I have the doubt that the hosting library has some problems and it is not able to manage the screen size changing from 240X320 to 320X240.. Has anybody experienced the same problem? Is there any work around? I am starting to investigate the HostingLibrary code , but if in the mean time someone has a solution to this problem I would kindly appreciate. Thanks so much in Advance for your cooperation. Carlo DE PAULIS (Italy)Anonymous
December 10, 2007
I used the Aximp.exe with Axis ActiveX to have the .cs file, I compiled the project and I have my AxAxisMediaControlLib in the Visual Studio Designer. I added the object in my form, built without error, but when I try to run the application i have this error: COMExecption Class not registered in HostingLybrary.dll Somebody know how to fix it Thank You very much