# %CoInvoke interface

Call a method.

## Syntax

```
retcode = %CoInvoke(Param1, Param2, Param3, Param4, Param5, Param6, … )
```

## Parameter(s)

| Param1 [in] | Dispatch object containing the IDispatch this call is associated with. |
| --- | --- |
| Param2 [in] | String - The method name. |
| Param3 [in] | Flag identifying the type of IDispatch call: DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, or DISPATCH_METHOD. |
| Param4 [out] | If this is a call to get an IDispatch, the output is a dispatch object containing the returned IDispatch. Otherwise, pass 0 as the input value. |
| Param5 [in] | String specifying the data types of arguments (pass 0 if no arguments). |
| Param6 [in] | Argument #1. |

## Returns

A Boolean (Success or Fail)

## Error Handling

Call CoGetException to get an error description.

## See also

- [Using the COM interface to FlashBASIC](https://d3codex.com/pickbasic-flashbasic/using-the-com-interface-to-flashbasic/)
- [FlashBASIC automation application interfaces](https://d3codex.com/pickbasic-flashbasic/flashbasic-automation-application-interfaces/)

---
Source: https://d3codex.com/pickbasic-flashbasic/coinvoke-interface/ - part of the D3Codex reference.
