0

I'm currently searching a way to call function that are inside a C++ dll. I work with C# and C++ but it seems I can't use reflection on a dll and calling function by their name with a string.

I saw some post on ctypes, but I'm not sure if it would fit my needs. What I need is a python library that could introspect a C++ dll, then I could call function, like for say getFood() with a string like myDll.call('getFood').

Thank you.

1
  • Can you use C++ to call the functions even? As in, are the functions you want to call properly exported in the DLL? Commented Jan 6, 2016 at 0:31

1 Answer 1

2

Yes, ctypes is what you need. use:

dllobj = ctypes.WinDLL("dll file name")

to load the DLL into memory. You can then find functions and call them. This does a nice job of explaining.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.