Not jet looked really deep into it but creating new instances of objects
in a QueryInterface call violates basic rules of COM. Every call
of QueryInterface for a given IID _MUST_ return a pointer to the same
object means:
QueryInterface is never supposed to create objects.

(Example how to do such things shell32/shlfolder.c)

juergen

>      if ( IsEqualGUID( &IID_IDirectDraw, refiid ) ) {
> -     ICOM_VTBL(This) = (ICOM_VTABLE(IDirectDraw2)*)&xlib_ddvt;
> +     IDirectDrawImpl *dd = HeapAlloc(GetProcessHeap(),0,sizeof(*dd));
>       IDirectDraw2_AddRef(iface);
> -     *obj = This;
> +
> +     dd->ref = 1;ICOM_VTBL(dd) = &xlib_ddvt;dd->d = This->d;This->d->ref++;
> +     *obj = dd;


---
[EMAIL PROTECTED]

... from sunny Berlin

Reply via email to