I try to call a function from a com server with the signature (.idl file):
typedef [v1_enum] enum Mode
{
Mode1,
Mode2
}
Mode;
[id(33)] HRESULT GetPosition
(
[out] double* x,
[out] double* y,
[in] Mode positionMode
);
The python code looks like:
import win32com.client
obj = win32com.client.gencache.EnsureDispatch('Server.Object.1')
from win32com.client import constants as c
(x,y) = obj.GetPosition(Mode=c.Mode1)
# I tried also x,y=... x=...
And I get the error message
pywintypes.com_error: (-2147352562, 'Invalid number of parameters.', None, None)
It works well when passing parameters to functions or returning single output arguments, like:
obj.setValue(42)
x = obj.getValue()
How can I deal with multiple output parameters?