When the target is a PointerTypeDef, returns a PointerInstance with
.contents and [index] access — equivalent to Python's
cast(c_void_p(addr), POINTER(MyStruct)).
A FuncPtrFactory target returns a caller with that prototype.
Param: ptr
Memory, a pointer/address, or a native function/callback
Param: targetType
The target type (primitive, struct, POINTER or CFUNCTYPE)
Example: Cast to POINTER for typed array access
// Python: cast(c_void_p(addr), POINTER(MyStruct)) constpValues = cast(col.pADsValues, POINTER(ADSVALUE)); for (leti = 0; i < col.dwNumValues; i++) { console.log(pValues[i].dwType); }
Interpret a pointer as a different type.
Python equivalent:
ctypes.castWhen the target is a PointerTypeDef, returns a PointerInstance with
.contentsand[index]access — equivalent to Python'scast(c_void_p(addr), POINTER(MyStruct)). A FuncPtrFactory target returns a caller with that prototype.