<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Maryam,<div class=""><br class=""></div><div class=""> The problem is that your ctypes.CDLL(‘tracer_v2.dll’) can’t find the file ‘tracer_v2.dll’. Probably if Chimera does not start in the directory with that dll it won’t find it. You should give it a full path to the file. If the DLL is in the same directory as your ctypes call then you might try</div><div class=""><br class=""></div><div class="">from os import path</div><div class="">dll_path = path.join(path.dirname(__file__), ‘tracer_v2.dll’)</div><div class="">dll = ctypes.CDLL(dll_path)</div><div class=""><br class=""></div><div class=""> Tom</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 13, 2015, at 7:24 AM, MARYAM ARAB <<a href="mailto:marab002@odu.edu" class="">marab002@odu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Dear Developers,<br class=""><br class=""></div>Hi,<br class=""></div>I have a C++ program and I want to package it under the tools menu. I made a dll from my program. <br class="">My dll gets two input ( pdb name and volum density level ,)<br class="">and generate the output. when I save the python codes to execute my dll in the chimera IDLE, every thing works well and my program starts working and generates the output. here is the code that I ran in the IDLE:<br class=""> <br class=""> import ctypes<br class=""> dll = ctypes.CDLL('tracer_v2.dll')<br class=""> dll.calc.argtypes = [ctypes.c_char_p, ctypes.c_double]<br class=""> dll.calc.restype = ctypes.c_int<br class=""> print(dll.calc('1733_H',3))<br class=""><br class=""></div>The problem that I faced is that when I add an extension button to the chimera and wants to call my function (calc('1733_H', 3) ) from there, I get an error:<br class=""><br class=""><span style="color:rgb(61,133,198)" class="">WindowsError Exception in Tk callback<br class=""> Function: <function command at 0x0D1A89B0> (type: <type 'function'>)<br class=""> Args: ()<br class="">Traceback (innermost last):<br class=""> File "C:\Program Files (x86)\Chimera 1.10.1\bin\lib\site-packages\Pmw\Pmw_1_3_3\lib\PmwBase.py", line 1747, in __call__<br class=""> return apply(self.func, args)<br class=""> File "C:\Program Files (x86)\Chimera 1.10.1\share\chimera\baseDialog.py", line 449, in command<br class=""> getattr(s, buttonFuncName(txt))()<br class=""> File "Z:\Tracer_Chimera\GUI\TracerUI\gui.py", line 43, in Apply<br class=""> TracerUI.mainchain()<br class=""> File "Z:\Tracer_Chimera\GUI\TracerUI\__init__.py", line 9, in mainchain<br class=""> dll = ctypes.CDLL('tracer_v2.dll')<br class=""> File "C:\Program Files (x86)\Chimera 1.10.1\bin\lib\ctypes\__init__.py", line 365, in __init__<br class=""> self._handle = _dlopen(self._name, mode)<br class="">WindowsError: [Error 126] The specified module could not be found<br class=""><br class=""></span></div><div class=""><span style="color:rgb(61,133,198)" class=""><span style="" class="">Would you please help me know how I can fix it?</span><br class=""><br class=""></span></div><div class=""><span style="" class="">Thanks, <br class=""></span></div><div class=""><span style="color:rgb(61,133,198)" class="">Maryam Arab<br class=""></span></div><div class=""><span style="" class="">Research Assistant<br class=""></span></div><div class=""><span style="color:rgb(61,133,198)" class=""><span style="" class="">Old Dominion University</span><br class=""></span></div><div class=""><div class=""><br class=""><br class=""></div></div></div>
_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev<br class=""></div></blockquote></div><br class=""></div></body></html>