kdemm backends & Helix

Ryan Gammon rgammon at real.com
Fri Sep 17 19:14:44 BST 2004


Koos Vriezen wrote:

>Kevin Krammer wrote:
>On Wednesday 15 September 2004 04:14, Ryan Gammon wrote:
>  
>
>OT, but although COM/XPCOM sounds pretty cool, unless one wants all
>interfaces known at front (eg. in kdelibs) 
>

The "advantage" of com is that you don't need to know the interfaces up 
front.

>so dynamic_cast will do, for
>this the compiler needs support for this, no?
>

You don't need dynamic_cast.

In general, you'll have stuff like

void someFunc (IUnknown* pUnk)
{
    IKoos* pKoos = NULL;

    pUnk->QueryInterface(IID_KOOS, (void**) &pKoos)
    if(pKoos)
    {
         // Do stuff
         pKoos->Release();
    }
}

class CKoos : public IKoos;

void CKoos::QueryInterface(IID iid, void** ppObj)
{
    *ppObj = NULL;
    if(iid == IID_KOOS)
    {
       *ppObj = (IKoos*) this;
    }
}

... so you're really using void*'s.

>Something to do with casting
>given an UID. Maybe someone can sched some light on this how this is
>done in mozilla.
>  
>

It's basically like this in helix and mozilla. In mozilla, you have the 
ability to make calls between languages, so I can have a JavaScript 
implementation of CKoos, and use it via its C++ interface definition, 
IKoos, which is cool.

-- 

Ryan Gammon
rgammon at real.com
Developer for Helix Player
https://player.helixcommunity.org



More information about the kde-multimedia mailing list