Python vb dll call

So, I have a function in vb that translates to a DLL that I want to use in python. However, trying to use it, I get an error message this is a VB function

Function DISPLAYNAME(Name)
MsgBox ("Hello " & Name & "!")
End Function

and so I call it in python

from ctypes import *
test = windll.TestDLL
print test
print test.DISPLAYNAME("one")

But I get errors, so this is the correct way to call dll

Traceback (most recent call last):
  File "C:\Test\testdll.py", line 4, in <module>
    print test.DISPLAYNAME("one")
  File "C:\Python26\lib\ctypes\__init__.py", line 366, in __getattr__
    func = self.__getitem__(name)
  File "C:\Python26\lib\ctypes\__init__.py", line 371, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'DISPLAYNAME' not found

I watch online, but there is no solution yet. It is not possible to use cdll because it is for c-programs.

I examined some issues related to python and dll, but still have not been able to solve the problem.

+3
source share
2 answers

I do not answer your specific question, but if it is VB.NET, you can initially call it in IronPython .

0
source

, Public access .

Public Function DISPLAYNAME(Name)
MsgBox ("Hello " & Name & "!")
End Function

dll

0

All Articles