Hello,
Is it possible to use ctypes for this? I tried a sample code from net but it is not working.

from ctypes import cdll

myDll = ctypes.LoadLibrary('C++dll.dll')

mydll.testString()

Can u tell me how to load a C++ dll and call the functions from python?

Recommended Answers

All 6 Replies

Have you tried google?

Yes i googled and i found similar kind of code in a website.But when i run this it is not working?

Post that code for checkup ;)

Hello,
Is it possible to use ctypes for this? I tried a sample code from net but it is not working.

from ctypes import cdll

myDll = ctypes.LoadLibrary('C++dll.dll')

mydll.testString()

Can u tell me how to load a C++ dll and call the functions from python?

I can see typo on your code. myDll is not the same as mydll

Also ctypes is not imported

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.