printf("impl == %x\n", (int) impl); printf("foo  == %x\n", (int) foo); printf("bar  == %x\n", (int) bar);
printf("impl == %p\n", impl); printf("foo  == %p\n", foo); printf("bar  == %p\n", bar);
static void DoMultipleInheritenceTest(){    FooBarImpl* impl = new FooBarImpl();    if(!impl)        return;    nsIFoo* foo;    nsIBar* bar;    nsXPTCVariant var[1];    printf("\n");    if(NS_SUCCEEDED(impl->QueryInterface(NS_GET_IID(nsIFoo), (void**)&foo)) &&       NS_SUCCEEDED(impl->QueryInterface(NS_GET_IID(nsIBar), (void**)&bar)))    {        printf("impl == %x\n", (int) impl);        printf("foo  == %x\n", (int) foo);        printf("bar  == %x\n", (int) bar);        printf("Calling Foo...\n");        printf("direct calls:\n");        foo->FooMethod1(1);        foo->FooMethod2(2);        printf("invoke calls:\n");        var[0].val.i32 = 1;        var[0].type = nsXPTType::T_I32;        var[0].flags = 0;        XPTC_InvokeByIndex(foo, 3, 1, var);        var[0].val.i32 = 2;        var[0].type = nsXPTType::T_I32;        var[0].flags = 0;        XPTC_InvokeByIndex(foo, 4, 1, var);        printf("\n");        printf("Calling Bar...\n");        printf("direct calls:\n");        bar->BarMethod1(1);        bar->BarMethod2(2);        printf("invoke calls:\n");        var[0].val.i32 = 1;        var[0].type = nsXPTType::T_I32;        var[0].flags = 0;        XPTC_InvokeByIndex(bar, 3, 1, var);        var[0].val.i32 = 2;        var[0].type = nsXPTType::T_I32;        var[0].flags = 0;        XPTC_InvokeByIndex(bar, 4, 1, var);        printf("\n");        NS_RELEASE(foo);        NS_RELEASE(bar);    }    NS_RELEASE(impl);}