Method Element for Class for COMLibrary (ProxyGen)
Represents a method that is defined in a proxy type for a COM type.
<Method dispID = "Dispatch ID of method"
invokeType = "Specifies how to invoke the method"
isExternal = "true/false"
isExcluded = "true/false"
newName = "New name of method in proxy type"
originalName = "Name of original method">
<Attribute>...</Attribute>
<DeclaringType>...</DeclaringType>
<Parameter>...</Parameter>
<ReturnType>...</ReturnType>
<ReturnValueAttribute>...</ReturnValueAttribute>
</Method>
COMMethod_Type
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute |
Description |
---|---|
dispId |
Required xs:long attribute. The dispatch ID of the method. |
invokeType |
Required comInvokeType_Type attribute. This attribute can have one of the following values that specify how the method will be invoked:
|
isExternal |
Optional xs:boolean attribute. true to declare the method using the extern keyword; otherwise, false. The default is false. |
isExcluded |
Optional xs:boolean attribute. true to omit the method from the proxy code; false to include the method in the proxy code. The default is false. |
newName |
Optional name_Type attribute. The new name of the method in the proxy code. |
originalName |
Required name_Type attribute. The name of the original method in the host application's object model. |
Child Elements
Element |
Description |
---|---|
Optional Attribute_Type element. Represents an attribute that is applied to the method. |
|
Optional TypeReference_Type element. Represents the interface or base type in which the method is declared, if the method is an explicit interface implementation or an override. The type cannot be an array. |
|
Optional Parameter_Type element. Represents a parameter of the method. |
|
Optional ArrayTypeReference_Type element. Describes the type of the return value of the method. The type can be an array. |
|
Optional Attribute_Type element. Describes an attribute applied to the return value of the method. |
Parent Elements
Element |
Description |
---|---|
Represents a proxy class for a COM class. |
|
Represents a proxy interface for a COM interface. |
Example
The following example demonstrates a Method element that represents a proxy method named Load.
<Method originalName="Load" isExcluded="false" dispId="7" invokeType="InvokeMethod">
<Parameter originalName="savedState">
<Attribute>
<Type>
<ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.MarshalAsAttribute" />
</Type>
<Parameter value="SafeArray">
<Type>
<ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.UnmanagedType" />
</Type>
</Parameter>
<NamedParameter name="SafeArraySubType" value="VT_UI1">
<Type>
<ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.VarEnum" />
</Type>
</NamedParameter>
</Attribute>
<Type>
<ExternalTypeReference isInterface="false" type="System.Byte" arrayInfo="[]" />
</Type>
</Parameter>
<ReturnType>
<ExternalTypeReference isInterface="false" type="System.Void" />
</ReturnType>
</Method>
Element Information
Namespace |
https://schemas.microsoft.com/vsta/2008/01/ProxyGenDescriptor |
Schema name |
ProxyGen Descriptor |
Validation file |
ProxyGenDescriptorv2.xsd |
Can be empty |
Yes |