>C/C++:
>
>int someFunc(void **ppint);
>
>And I have seen it (in COM literature for example) cast like:
>
>x = someFunc((void**) *&pvar);
COM objects are always by reference. You never have a pointer to the actual object, just a pointer to the interface which in turn has the VTABLE to the actual entry point offsets. So COM objects are always doubly derereferenced which is what that syntax above is. It's the address of the Interface pointer.
Bottom line is in COM and VFP a like - there's always only a single instance of an object no matter how many reassignments or passings to methods occur. The only way to create a new object is do CreateObject() or CoCreateInstance on it.
In C++ you can create native, static object variables. Those are essentially structures which can be passed by value or by reference and they will exhibit different behaviors with the former causing a copy to be made of the object structure. By value means copying a memory footprint - it's very inefficient to do this for complex objects. If you have references to other objects those will still be object references that won't be copied for example unless they're embedded.
In general there's no need to ever pass an object by value - if you do, I'd say there's a design problem that can be solved easily by creating data members that can be copied.
>
>What is the reason for this?
>
>TIA,
>Bill