satype

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

Specifies the data type of the SAFEARRAY structure.

  
      [ satype(  
   data_type  
) ]  

Parameters

data_type
The data type for the SAFEARRAY data structure that is being passed as a parameter to an interface method.

Attribute Context

Applies toInterface parameter, interface method
RepeatableNo
Required attributesNone
Invalid attributesNone

The satype C++ attribute specifies the data type of the SAFEARRAY.

System_CAPS_ICON_note.jpg Note

A level of indirection is dropped from the SAFEARRAY pointer in the generated .idl file from how it is declared in the .cpp file.

// cpp_attr_ref_satype.cpp  
// compile with: /LD  
#include "unknwn.h"  
[module(name="MyModule")];  
[dispinterface, uuid("00000000-0000-0000-0000-000000000001")]  
__interface A {  
   [id(1)] HRESULT MyMethod ([in, satype("BSTR")] SAFEARRAY **p);  
};  

Compiler Attributes
Parameter Attributes
Method Attributes
id
Attributes Samples

Show: