dllexport

C# Return Type Issue

耗尽温柔 提交于 2019-12-12 18:42:46
问题 I have a C# Class Library DLL that I call from Python. No matter what I do, Python thinks the return type is (int) I am using RGiesecke.DllExport to export the static functions in my DLL, here is an example of a function in my C# DLL: [DllExport("Test", CallingConvention = CallingConvention.Cdecl)] public static float Test() { return (float)1.234; } [DllExport("Test1", CallingConvention = CallingConvention.Cdecl)] public static string Test1() { return "123456789"; } If I return an (int) it

Generating correct .DEF files to export non-static functions AND GLOBALS

六月ゝ 毕业季﹏ 提交于 2019-12-12 18:34:39
问题 Following on from a question about detecting bad linkage to globals across dll boudaries, it turns out that I need to modify a .DEF file generator tool used by the PostgreSQL project so that it correctly emits DATA tags for .DEF entries for global variables. Problem I can't seem to find a way, using Microsoft's tools, to get a symbol table listing that differentiates between global variables and functions, and that includes globals that aren't initialized at their definition site. Ideas?

Should enums be exported out of dll or not?

余生颓废 提交于 2019-12-12 13:17:21
问题 The project (in cpp) we are working on exports enum types from the dll. In exporting we are having some issues so I wanted to ask something related to exporting enum type. I think that enum's behave like 'kind of' constants, so they do not provide any 'functionality' to the user. So, can we omit the exporting of enum's ? OR Are there some functionalities (other than behaving as constants) that the enum's provide to the end-user that makes it necessary to export them ? More details : We have a

Robert Giesecke's Unmanaged Exports

半城伤御伤魂 提交于 2019-12-12 12:40:36
问题 I'm trying to get an DllExport from vb.net to unmanaged c++ working. I'm using Robert Giesecke's Unmanaged Exports with Visual Studio 2012 and tried to follow this very helpful hints. I copy the dlls from the .Net project by an post build action in the directory where my *.cpp and *.h files reside. I checked my dll with dumpbin /EXPORTS Nugget.Discovery.dll and it tells me that there are exports: File Type: DLL Section contains the following exports for \Nugget.Discovery.dll 00000000

Exported variable vs exported function in a DLL

南笙酒味 提交于 2019-12-11 19:32:07
问题 How to know if the exported symbol from a dll is actually variable or a function ? One way may be to look whether the destination address of the symbol resides in the .code section or not. Another method could be to check the memory protection attributes of the selected section. But all these methods seem to be unreliable. What is the best way ? 来源: https://stackoverflow.com/questions/22651581/exported-variable-vs-exported-function-in-a-dll

Exporting functions from a DLL using __declspec(dllexport)

被刻印的时光 ゝ 提交于 2019-12-11 19:09:07
问题 I 'm working on a project (VS 2012 solution) including joystic.cpp. Project has been created as DLL, in order to be able to call library from another project. The application receives immediate joypad data in exclusive mode via a dialog timer, displaying them in a dialog box. I edited the resource.h file with macro: #ifdef LIBRARY_EXPORTS # define LIBRARY_API __declspec(dllexport) #else # define LIBRARY_API __declspec(dllimport) #endif in order to be able to export functions by ordering:

The value of ESP was not properly saved across a function call error

心已入冬 提交于 2019-12-11 14:56:15
问题 I made a .dll file with QT and I load it in my application. When it's about to return from one function, I receive: The value of ESP was not properly saved across a function call I start with the DLL project: This is my device_manager_interface.hpp: #ifndef __DEVICE_MANAGER_INTERFACE_HPP__ #define __DEVICE_MANAGER_INTERFACE_HPP__ #include <QtCore> class DeviceManagerInterface { public: virtual BCR * getDeviceBCR() = 0 ; . . . }; QT_BEGIN_NAMESPACE Q_DECLARE_INTERFACE(DeviceManagerInterface,

C# Export function dll

自古美人都是妖i 提交于 2019-12-11 12:18:46
问题 I use the Unmanaged-Exports package from Robert Giesecke, which can be found at (https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports). I'd like to export a function but somehow it doesn't work. The functions won't be exported. My approach: Code: [DllExport("test", CallingConvention = CallingConvention.StdCall)] public static string test() { return "Hello World, this is the DLL"; } Screenshot of my IDA results: As you can see they're empty because no function was

Visual Studio 2008 release build not decorating DLL exports

百般思念 提交于 2019-12-11 11:39:39
问题 I'm building a C++ DLL in Visual Studio 2008 to be used by a C application written in Borland C++ Builder 6. My debug DLL build exports methods decorated with an underscore. However in my release DLL build the methods are not decorated causing linker errors in C++ Builder. (See below for output for dumpbin.exe for both build types) I've checked the compiler options for both debug and release configuration and cannot see anything that might be causing this problem. I've managed it get around

Dumpbin shows strange method name (generating exporting function in MS Visual C++)

烂漫一生 提交于 2019-12-11 10:35:58
问题 I have created new Win32 project in my VS and have selected Dynamic Library ( *.dll ) for this aim. I have defined some exporting function in the main file: __declspec(dllexport) int TestCall(void) { int value = 4 / 2; std::cout << typeid(value).name() << std::endl; return value; } __declspec(dllexport) void SwapMe(int *first, int *second) { int tmp = *first; *first = *second; *second = tmp; } When I've looked at the dumpin /exports, I've got: ordinal hint RVA name 1 0 00001010 ?SwapMe@