Python Forum
Using C++/CLI wrapper functions by Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using C++/CLI wrapper functions by Python
#1
Hello,

I have created C++ Dll to be loaded by many programs, interfaces (also Python). This Dll is calling another C++/CLI Dll wrapper which wraps C# Dll (Licencing functions).

This program can work in several interfaces fine (C++ .exe, C# GUI...), but when calling by Python it fails always on the C++/CLI Dll wrapper function. In this, it is also unable to go inside the C++/CLI Dll function (probably unable to load the Dll). When I call it from Python console, I receive

Traceback (most recent call last): File "", line 1, in OSError: [WinError -532462766] Windows Error 0xe0434352

I found out on internet that this is reported by many authors. But I was not able to find any solution.

I really don't understand why is that? As I mentioned, I call Dll also from C++ .exe or C# .exe without any problem. Also if I comment wrapper function, then can use all C++ Dll functions without errror.

Thank you in advance for your answer.
Reply
#2
Hello,

I have an issue similar to the one you describe, raising the same error. I developed a DLL in C++ that, for a specific case, call a function of a second (external) DLL. It works fine in C++ but it fails for this specific case when it is called from Python code.
Following this thread, https://stackoverflow.com/questions/4579...reated-dll, I have found that if I put my external DLL where my python.exe is it works fine.

I then tried to specify the path to my external DLL using the function os.add_dll_directory() but it seems to be useless.

Since you asked your question 3 months ago, I was wondering if you found a way to overcome your issue?

Thanks
Reply
#3
Hello,

I am really suprised. I found out that this forum is dead.

The problem was as you described. It is assumed that dependencies are nearby .exe (Python). Here is the solution

http://pragmateek.com/if-your-plumbing-d...#more-1745

Hope this help you as me.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SystemError: <method-wrapper '__getattribute__' of EnumMeta object sciloop 4 1,520 Jul-23-2022, 07:57 PM
Last Post: sciloop
  Python executable Script (Wrapper) Hwang 2 1,899 Jan-12-2022, 06:53 PM
Last Post: Hwang
  Sqla wrapper Slojure 1 1,540 Nov-01-2021, 04:36 PM
Last Post: Larz60+
  Python C++ wrapper problem JESuh 1 2,173 Mar-30-2021, 04:37 PM
Last Post: nilamo
  C++ Wrapper for python yamifm0f 6 3,124 Nov-07-2019, 06:40 PM
Last Post: Gribouillis
  generating ctypes wrapper for a c library? brighteningeyes 9 7,085 Nov-04-2018, 02:31 AM
Last Post: brighteningeyes
  how to retrieve datas with Overpass API python wrapper apollo 0 2,921 Oct-15-2017, 02:27 PM
Last Post: apollo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020