Microsoft SDK for Java

MCVtblMethod

The MCVtblMethod structure describes a vtable-based method in a COM interface. References to this structure can appear in both COM_ExposedAs_Group and COM_ProxiesTo attributes.

VtblMethod_attribute {
    u2 IIDIndex;
    u2 VTblIndex;
    u2 nArguments;
    u2 wRetValParameter
    MCTypeDesc RetType;
    MCTypeDesc aParamType[nArguments];
}

The C structure MCVtblMethod, declared in comattr.h, defines the layout of this attribute for use in C/C++ programs.

Structure Elements

IIDIndex

A valid index into the GUID pool that describes the IID of the COM interface that implements this method. An index of 0xffff is invalid.

VTblIndex

Denotes which vtable element the method occupies. Index values of 0 (zero), 1 and 2 are not legal because these correspond to the IUnknown* methods, which cannot be overridden. In addition, if the method pool contains MCDispMethods using the same IID (a DUAL interface), index values 3, 4, 5, and 6 must not be specified because they correspond to IDispatch* methods supplied by the Microsoft VM.

nArguments

Indicates the number of parameters in the aParamType[] element. This count does not include the automatic this parameter passed to all COM methods. If the wRetValParameter element is 0xffff, this count must exactly match the number of parameters in the corresponding Java signature. Otherwise, the count must be exactly one greater than the corresponding Java signature.

wRetValParameter

If this item contains a value other than 0xffff, it must contain a value between 0 (zero) (inclusive) and nArguments (exclusive). This indicates that the parameter whose index is equal to wRetValParameter is actually a pointer through which the method returns its true return value. The aParamType entry for this parameter must indicate the type of the buffer (the pointer to is implicit), and RetType must be TD_VOID. In addition, the return type of the Java method signature must be compatible with the retval parameter.

If this COM method is invoked from Java, the VM will supply a return value buffer of the appropriate type to the COM method. See the MCFuncDesc flags for what constitutes a successful return from the COM method.

If Java is used to implement this COM method, the VM will remove the retval pointer parameter from the list of arguments presented to the Java method. When the Java method returns, the VM converts the Java method's return value to COM representation, then write it to the retval buffer passed in from COM. The VM creates a COM return value that indicates success See the MCFuncDesc flags for what constitutes a successful return.

RetType

An MCTypeDesc structure that describes the return type. This type must be TD_VOID if wRetValParameter contains a value other than 0xffff, or if MCFuncDesc.Flags has the MCMDF_HRESULT_RETVAL bit set.

aParamType

Describes the parameter of each COM method.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.