Here is the solution:
COM methods accept an additional parameter: a pointer to 'this'. This is implied when you call a method from C ++, in C (and in ctypes) you must provide it yourself.
Change the line
func_proto = ctypes.WINFUNCTYPE(HRESULT, HWND)
in
func_proto = ctypes.WINFUNCTYPE(HRESULT, c_long, HWND)
and this line
show(0)
in
show(ptr, 0)
and your code will work.
source share