pointer_default ( ptr | ref | unique )
[uuid(6B29FC40-CA47-1067-B31D-00DD010662DA),
version(3.3),
pointer_default(unique)]
interface dictionary
The pointer_default attribute specifies the default pointer attribute for all pointers except top-level pointers that appear in parameter lists. This includes embedded pointers — pointers that appear in structures, unions, and arrays. The pointer_default attribute can also apply to pointers returned by functions.
MIDL generates an error during compilation when you do not supply a pointer attribute in an interface that includes embedded pointers.
The default pointer type does not apply to pointers that appear as top-level parameters, such as individual pointers used as function parameters. You must supply the appropriate pointer attribute for these pointers, as shown in this example:
HRESULT Method1( [unique] MYTYPE* pMYTYPE );
The default is always overridden when a pointer attribute is supplied. If all pointers are supplied with pointer attributes, the default attribute is ignored.
The pointer_default attribute is an optional attribute in the IDL file. The pointer_default attribute is required only in the interface header when:
If the pointer_default attribute appears in the interface header and is not required, it is ignored.
interface, pointers, ptr, ref, unique