Using DSRemoteConnect

Benjamin Keckeis

Posted on 12.02.2025 14:51

Hello,


I am trying to use the DSRemoteConnect library, but when running the example code in pyhon none of the functions in the dll-file can be found.

ctypes.WinDll works fine, but dsconCreateInstance for example and all the other functions couldn't be found.

Does the dll-file also need DSXInstance.h to be in the same folder in order to work poperly, because the include of this header file does not work in DSRemoteConnect.h?


Can you please help me with that?


Thank you very much in advance,


Benjamin

Gregor Šmit

Posted on 17.02.2025 09:26

Dear Benjamin,


thank you for reaching out to us. The example should work as is and DSXInstance.h is not required in the same folder.


Would you please be so kind and tell us which example are you running - Example without or with NET?

Can you send us any errors that you receive?


Kind regards.

Benjamin Keckeis

Posted on 17.02.2025 09:39

Dear Gregor,


thank you for your reply. I am using the example without NET (DSRemoteConnect_Example.py) in Python (Python 3.11.4, 64bit). I am correctly using the 64bit dll. The error which I receive is the following:


  doErrCheck(hllDll.dsconCreateInstance(pointer(dsconInstance)), "dsconCreateInstance")

        ^^^^^^^^^^^^^^^^^^^^^^^^^^

 File "C:\Work\Lib\ctypes\__init__.py", line 389, in __getattr__

  func = self.__getitem__(name)

      ^^^^^^^^^^^^^^^^^^^^^^

 File "C:\Work\Lib\ctypes\__init__.py", line 394, in __getitem__

  func = self._FuncPtr((name_or_ordinal, self))

      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: function 'dsconCreateInstance' not found


I have been researching what this error is about and most sites noted, that this is often due to name mangling when not using "extern C" in the library. But this cannot be the case, as the following code finds the correct names of the functions in the DLL:

import pefile

dll_path = r"absolutePath/to/my/dll/File"

pe = pefile.PE(dll_path)

if hasattr(pe, 'DIRECTORY_ENTRY_EXPORT'):

    for export in pe.DIRECTORY_ENTRY_EXPORT.symbols:

        print(f'{export.name.decode() if export.name else "None"}: {hex(export.address)}')

else:

    print('No exported symbols found')

pe.close()


Thank you in advance,

Benjamin


Gregor Šmit

Posted on 20.02.2025 13:48

Dear Benjamin,


the problem was solved after changing the files to folder without any restrictions.


Kind regards.

Benjamin Keckeis

Posted on 20.02.2025 14:10

Dear Gregor,


yes, indeed. Thank you for your help.


Best regards,

Benjamin


Login to reply to this topic. If you don't have account yet, you can signup for free account .