pointer_default
pointer_default
( ptr | ref | unique
)
Example
[uuid(6B29FC40-CA47-1067-B31D-00DD010662DA),
version(3.3),
pointer_default(unique)]
interface dictionary
Remarks
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
does not apply to pointers that appear as top-level parameters, such as
individual pointers used as function parameters. A pointer attribute
must be supplied for these pointers. 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:
A parameter with more than one
asterisk (*) appears in a function.
A structure member or union arm
with a pointer declarator does not have a pointer attribute.
A function returns a pointer
type and does not have a pointer attribute as a function attribute.
If the pointer_default
attribute appears in the interface header and is not required, it is ignored.
See Also