Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dapperfu
Created September 4, 2019 13:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dapperfu/b00d91845ebd77f2a403842ab3d4c614 to your computer and use it in GitHub Desktop.
Save dapperfu/b00d91845ebd77f2a403842ab3d4c614 to your computer and use it in GitHub Desktop.
Passing a (const char *) in ctypes.
dll = canape.dll
hdl = canape.handle
directory = ctypes.create_string_buffer(b"", 256)
size = ctypes.c_ulong()
# Asap3GetProjectDirectory
dll.Asap3GetProjectDirectory.argtypes=(TAsap3Hdl, ctypes.POINTER(type(directory)), ctypes.POINTER(ctypes.c_ulong))
dll.Asap3GetProjectDirectory.restype=ctypes.c_bool
result = dll.Asap3GetProjectDirectory(
hdl,
ctypes.byref(directory),
ctypes.byref(size),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment