Export (0) Print
Expand All

FUNCDESC Structure

Describes a function, and is defined as follows:

typedef struct tagFUNCDESC {
   MEMBERID memid;                  // Function member ID.
SCODE FAR *lprgscode;
ELEMDESC FAR *lprgelemdescParam;   
FUNCKIND funckind;               // Specifies whether the    
                                 // function is virtual, static,    
                                 // or dispatch-only.
   INVOKEKIND invkind;      // Invocation kind. Indicates if this is a    
                           // property function, and if so, what kind.
   CALLCONV callconv;      // Specifies the function's calling 
                     // convention.
   short cParams;         // Count of total number of parameters.
   short cParamsOpt;      // Count of optional parameters (detailed 
                     // description follows).
   short oVft;      // For FUNC_VIRTUAL, specifies the offset in the VTBL.
   short cScodes;      // Count of permitted return values. 
   ELEMDESC elemdescFunc;   // Contains the return type of the function.
   WORD wFuncFlags;    // Definition of flags follows.

The cParams field specifies the total number of required and optional parameters.

The cParamsOpt field specifies the form of optional parameters accepted by the function, as follows:

  • A value of 0 specifies that no optional arguments are supported.

  • A value of –1 specifies that the method's last parameter is a pointer to a safe array of variants. Any number of variant arguments greater than cParams –1 must be packaged by the caller into a safe array and passed as the final parameter. This array of optional parameters must be freed by the caller after control is returned from the call.

  • Any other number indicates that the last n parameters of the function are variants and do not need to be specified by the caller explicitly. The parameters left unspecified should be filled in by the compiler or interpreter as variants of type VT_ERROR with the value DISP_E_PARAMNOTFOUND.

For 16-bit systems (Macintosh), the fields cScodes and lprgscode store the count and the set of errors that a function can return. If cScodes = –1, then the set of errors is unknown. If cScodes = –1, or if cScodes = 0, then lprgscodeis undefined.

© 2014 Microsoft