← Back to team overview

sikuli-driver team mailing list archive

[Question #698490]: Using custom c++ dll in Sikulix

 

New question #698490 on SikuliX:
https://answers.launchpad.net/sikuli/+question/698490

Hello,
I've written a small c++ dll to crypt and decrypt strings, I have to use it from .net and from Sikulix; it works if called from .net code.
The two functions have these prototypes:
int encrypt( char str2Encrypt[]);
void decript(unsigned char strDecrypt[]);

Checking in the Jython source I've found c:\jython2.7.2\Lib\ctypes\__init__.py that gave me some hints about how to load it:
import ctypes
from ctypes import *
libc = ctypes.LibraryLoader (".\\DllPAss.dll")

And this works (at least no runtime error), the output of the 
print libc
line is:
<ctypes.LibraryLoader object at 0x4>.
My problem is that then I'm stuck since the line:
libc.LoadLibrary("encrypt") and others attempt I've done
outputs these errors:
[error] script [ testScript ] stopped with error in line 17
[error] TypeError ( 'str' object is not callable )
[error] --- Traceback --- error source first
line: module ( function ) statement 
289: __init__ (  LoadLibrary )     return self._dlltype(name)
17: main (  <module> )     libc.LoadLibrary("encrypt")
[error] --- Traceback --- end --------------

I'm not an expert of python, so the problem could be that I'm simply ignoring the way it should be, does anyone has an example to follow?
Thanks in advance

My config is as follows:
sikulix 2.0.5, java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.