Class not registered

Last post 12-06-2007 6:59 by ctacke. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-07-2006 22:50

    Class not registered

    I am just trying to run the example from Hosting an activex on my windows ce 5.0 platform, but as I am clicking on the "Media Player Demo" I get an error that "Class not found",

    I am using Windows Media Player 9

    regards
  • 01-18-2007 1:02 In reply to

    Re: Class not registered

    quote:
    Originally posted by mchopra

    I am just trying to run the example from Hosting an activex on my windows ce 5.0 platform, but as I am clicking on the "Media Player Demo" I get an error that "Class not found",

    I am using Windows Media Player 9

    regards



    I have the same problem running the same example on a Windows Mobile 2003 (2nd edt.) platform, also WMP 9.0! Here is the stack trace:

    System.Runtime.InteropServices.COMException was unhandled
    Message="Class not registered "
    ErrorCode=-2147221164
    StackTrace:
    bei System.Windows.Forms.AxHost.CoCreateInstance()
    bei System.Windows.Forms.AxHost.CreateWithoutLicense()
    bei System.Windows.Forms.AxHost.CreateInstanceCore()
    bei System.Windows.Forms.AxHost.CreateInstance()
    bei System.Windows.Forms.AxHost.GetOcxCreate()
    bei System.Windows.Forms.AxHost.TransitionUpTo()
    bei System.Windows.Forms.AxHost.GetOcx()
    bei System.Windows.Forms.AxHost..ctor()
    bei System.Windows.Forms.AxHost..ctor()
    bei AxWMPLib.AxWindowsMediaPlayer..ctor()
    bei ControlHostingSample.MediaPlayer.InitializeComponent()
    bei ControlHostingSample.MediaPlayer..ctor()
    bei ControlHostingSample.frmMain.btnMediaPlayer_Click()
    bei System.Windows.Forms.Control.OnClick()
    bei System.Windows.Forms.Button.OnClick()
    bei System.Windows.Forms.ButtonBase.WnProc()
    bei System.Windows.Forms.Control._InternalWnProc()
    bei Microsoft.AGL.Forms.EVL.EnterMainLoop()
    bei System.Windows.Forms.Application.Run()
    bei ControlHostingSample.frmMain.Main()

    Please, does anyone have an idea, what might be the problem??

  • 05-22-2007 22:07 In reply to

    Re: Class not registered

    Hey!
    I am too facing same problem. Even i recreated this sorce code targetting cf2.0 but result is same. it works fine on emulator but not on device
  • 05-25-2007 4:46 In reply to

    Re: Class not registered

    I get the same stack trace and error code debugging on my target device but the exception says: "AxHost: unable to find license for the component"

    Same result building AxWMPLib against wmp.dll 9.0 and 11.0 for WinCE 5 and .NET CF 2.
  • 05-30-2007 1:53 In reply to

    Re: Class not registered

    Still, I don't have a solution to this interop-problem.
    But this is what I found out:

    The "Class not registered"-Exception appears only with Version 9 of Windows Media Player. The example from Alex Feinman makes use of the desktop-Version (Win32) of WMP10-DLL, which is compatible with the Pocket Version (CE/Mobile) of WMP10, but unfortunately is not compatible to Pocket WMP 9.

    I have tried to use the wmppia.dll from WMP9 SDK and also the WMPCEOCX.dll from my Windows Mobile Device in the same way as in the example, but aximp doesn't work with these.

    I also tried to P/Invoke functions from that dll, but without success.

    You should try to run your application on a device with WMP 10 installed, if possible. This should work.

    Another approach that I am currently trying is to manually write a AxWmpLib, fitting to the interface of the "Microsoft Windows Media Player 8.x for Pocket PC".
    In the first step, I create a type library from the "playerOCX.idl" contained in the "\Samples\MediaBookmarker"-directory of the SDK:
    midl playerocx.idl

    This produces "playerOCX.tlb". If some errors appear concerning a duplicate UUID, just comment these lines out.
    I can use this file to create a dll that can be referenced from the .NET-project:
    tlbImp playerocx.tlb


    This dll contains the interface-definitions for the Media Player 8.x Control and has to be added to your Project (add reference).

    Then I create a class that is inherited from AxHost. In the constructor, I call the base-constructor with the according GUID ("22D6F312-B0F6-11D0-94AB-0080C74C7E95"). After that, I can retrieve a WMP-ActiveX-Object via
    this.ocx = (PLAYEROCXLib.IWMP) base.GetOcx();


    I added a method/proprty URL to this class to set the name of the file that is to be played:
    public virtual string URL
    {
    get
    {
    if ((this.ocx == null))
    {
    throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("URL", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
    }
    return this.ocx.FileName;
    }
    set
    {
    if ((this.ocx == null))
    {
    throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("URL", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
    }
    this.ocx.FileName = value;
    }
    }


    I managed to compile this class to a dll, that can be added to the toolbar, just like in Feinmans example.

    I get this activeX-control running, playing a mp3-file, but video doesn't work yet. Don't know the reason at the moment, but for some strange reason, the display doesn't refresh properly.
    The same effect appears when embedding the control in an HTML-page in Pocket IE. (compatibility perhaps?)

  • 12-06-2007 2:25 In reply to

    Re: Class not registered

    I have the same problem!
    I used the Aximp.exe with AxisMediaControl.dll to create the .cs and the others files, I have the AxAxisMediaControl object in the Form but when I run the application I obtain this exception: System.Runtime.InteropServices.COMException' in HostingLibrary.dll Class Not registered.
    Did You solve the problem, tips?
    Thank You
  • 12-06-2007 6:59 In reply to

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 1,922

    Re: Class not registered

    The media player control in the webcast by Alex Feinman is for WMP 10, available on WM 5 and WM 5 devices only. If you don't have one of those devices, you'll get that error.
Page 1 of 1 (7 items)