小弟用python 写了个调用SiInterface.dll的adaptor.exe
这里有调用win32api.FreeLibrary()释放dll了,
运行该adaptor.exe后,做完一个交易后,其他程序调用这个dll做交易就会加载不到这个dll,请问是我没释放成功SiIterface.dll 还是adaptor.exe打开运行后,他就一直占用着SiInterface.dll
因为在使用adaptor.exe做完一个交易后关闭该exe,再使用别的程序调用SiInterface.dll就是ok的,请教各位大神如何在不关闭adaptor.exe情况下 还能是别的程序能够访问该SiInterface.dll
def call_mi_dll(sIn):
dll = ctypes.WinDLL('SiInterface.dll')
sIn += ' '*(512-len(sIn))
sOut = ' '*512
i=' '*1024
i=ctypes.c_char_p(i)
sIn = ctypes.c_char_p(sIn)
sOut = ctypes.c_char_p(sOut)
print "calling: SiInterface.dll -> INIT"
ret=dll.INIT(i)
print "Init :"+str(ret)
print "calling: SiInterface.dll -> BUSINESS_HANDLE"
dll.BUSINESS_HANDLE(sIn, sOut)
win32api.FreeLibrary(dll._handle)
return sOut.value