I am trying to call functions from a DLL which seems to be created in Delphi. An example of a some functions supported by the DLL are:
function oziDeleteWpByName(var name:pansichar):integer;stdcall
The Python code I have written to access the above functions is not working.
from ctypes import *
libc = cdll.OziAPI
name ='test'
pi = pointer(name)
delname = libc.oziDeleteWpByName
delname(name)
It seems I am passing the wrong data type to the function. Any ideas on how to do it right?
Thanks it worked. Now please help with this function:
function oziGetOziVersion(var Version:pansichar;var DataLength:integer):integer;stdcall; The version of OziExplorer is returned in the Version variable.
Now how do I pass 'var version' when it the one which will also be returned.
var name:pansichar
implies that thename
parameter can be modified and returned to the caller. Does the function really do that? Are you planning to read the contents ofname
after the function returns? – David Heffernanvar
declaration is fishy. If you, user 1138... wrote that DLL, why did you do that? – Warren P